3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
10 #define CYTHON_ABI "0_29_2"
11 #define CYTHON_HEX_VERSION 0x001D02F0
12 #define CYTHON_FUTURE_DIVISION 0
15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
29 #define DL_IMPORT(t) t
32 #define DL_EXPORT(t) t
35 #ifndef HAVE_LONG_LONG
36 #if PY_VERSION_HEX >= 0x02070000
37 #define HAVE_LONG_LONG
41 #define PY_LONG_LONG LONG_LONG
44 #define Py_HUGE_VAL HUGE_VAL
47 #define CYTHON_COMPILING_IN_PYPY 1
48 #define CYTHON_COMPILING_IN_PYSTON 0
49 #define CYTHON_COMPILING_IN_CPYTHON 0
50 #undef CYTHON_USE_TYPE_SLOTS
51 #define CYTHON_USE_TYPE_SLOTS 0
52 #undef CYTHON_USE_PYTYPE_LOOKUP
53 #define CYTHON_USE_PYTYPE_LOOKUP 0
54 #if PY_VERSION_HEX < 0x03050000
55 #undef CYTHON_USE_ASYNC_SLOTS
56 #define CYTHON_USE_ASYNC_SLOTS 0
57 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58 #define CYTHON_USE_ASYNC_SLOTS 1
60 #undef CYTHON_USE_PYLIST_INTERNALS
61 #define CYTHON_USE_PYLIST_INTERNALS 0
62 #undef CYTHON_USE_UNICODE_INTERNALS
63 #define CYTHON_USE_UNICODE_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_WRITER
65 #define CYTHON_USE_UNICODE_WRITER 0
66 #undef CYTHON_USE_PYLONG_INTERNALS
67 #define CYTHON_USE_PYLONG_INTERNALS 0
68 #undef CYTHON_AVOID_BORROWED_REFS
69 #define CYTHON_AVOID_BORROWED_REFS 1
70 #undef CYTHON_ASSUME_SAFE_MACROS
71 #define CYTHON_ASSUME_SAFE_MACROS 0
72 #undef CYTHON_UNPACK_METHODS
73 #define CYTHON_UNPACK_METHODS 0
74 #undef CYTHON_FAST_THREAD_STATE
75 #define CYTHON_FAST_THREAD_STATE 0
76 #undef CYTHON_FAST_PYCALL
77 #define CYTHON_FAST_PYCALL 0
78 #undef CYTHON_PEP489_MULTI_PHASE_INIT
79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80 #undef CYTHON_USE_TP_FINALIZE
81 #define CYTHON_USE_TP_FINALIZE 0
82 #undef CYTHON_USE_DICT_VERSIONS
83 #define CYTHON_USE_DICT_VERSIONS 0
84 #undef CYTHON_USE_EXC_INFO_STACK
85 #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87 #define CYTHON_COMPILING_IN_PYPY 0
88 #define CYTHON_COMPILING_IN_PYSTON 1
89 #define CYTHON_COMPILING_IN_CPYTHON 0
90 #ifndef CYTHON_USE_TYPE_SLOTS
91 #define CYTHON_USE_TYPE_SLOTS 1
93 #undef CYTHON_USE_PYTYPE_LOOKUP
94 #define CYTHON_USE_PYTYPE_LOOKUP 0
95 #undef CYTHON_USE_ASYNC_SLOTS
96 #define CYTHON_USE_ASYNC_SLOTS 0
97 #undef CYTHON_USE_PYLIST_INTERNALS
98 #define CYTHON_USE_PYLIST_INTERNALS 0
99 #ifndef CYTHON_USE_UNICODE_INTERNALS
100 #define CYTHON_USE_UNICODE_INTERNALS 1
102 #undef CYTHON_USE_UNICODE_WRITER
103 #define CYTHON_USE_UNICODE_WRITER 0
104 #undef CYTHON_USE_PYLONG_INTERNALS
105 #define CYTHON_USE_PYLONG_INTERNALS 0
106 #ifndef CYTHON_AVOID_BORROWED_REFS
107 #define CYTHON_AVOID_BORROWED_REFS 0
109 #ifndef CYTHON_ASSUME_SAFE_MACROS
110 #define CYTHON_ASSUME_SAFE_MACROS 1
112 #ifndef CYTHON_UNPACK_METHODS
113 #define CYTHON_UNPACK_METHODS 1
115 #undef CYTHON_FAST_THREAD_STATE
116 #define CYTHON_FAST_THREAD_STATE 0
117 #undef CYTHON_FAST_PYCALL
118 #define CYTHON_FAST_PYCALL 0
119 #undef CYTHON_PEP489_MULTI_PHASE_INIT
120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121 #undef CYTHON_USE_TP_FINALIZE
122 #define CYTHON_USE_TP_FINALIZE 0
123 #undef CYTHON_USE_DICT_VERSIONS
124 #define CYTHON_USE_DICT_VERSIONS 0
125 #undef CYTHON_USE_EXC_INFO_STACK
126 #define CYTHON_USE_EXC_INFO_STACK 0
128 #define CYTHON_COMPILING_IN_PYPY 0
129 #define CYTHON_COMPILING_IN_PYSTON 0
130 #define CYTHON_COMPILING_IN_CPYTHON 1
131 #ifndef CYTHON_USE_TYPE_SLOTS
132 #define CYTHON_USE_TYPE_SLOTS 1
134 #if PY_VERSION_HEX < 0x02070000
135 #undef CYTHON_USE_PYTYPE_LOOKUP
136 #define CYTHON_USE_PYTYPE_LOOKUP 0
137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138 #define CYTHON_USE_PYTYPE_LOOKUP 1
140 #if PY_MAJOR_VERSION < 3
141 #undef CYTHON_USE_ASYNC_SLOTS
142 #define CYTHON_USE_ASYNC_SLOTS 0
143 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144 #define CYTHON_USE_ASYNC_SLOTS 1
146 #if PY_VERSION_HEX < 0x02070000
147 #undef CYTHON_USE_PYLONG_INTERNALS
148 #define CYTHON_USE_PYLONG_INTERNALS 0
149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150 #define CYTHON_USE_PYLONG_INTERNALS 1
152 #ifndef CYTHON_USE_PYLIST_INTERNALS
153 #define CYTHON_USE_PYLIST_INTERNALS 1
155 #ifndef CYTHON_USE_UNICODE_INTERNALS
156 #define CYTHON_USE_UNICODE_INTERNALS 1
158 #if PY_VERSION_HEX < 0x030300F0
159 #undef CYTHON_USE_UNICODE_WRITER
160 #define CYTHON_USE_UNICODE_WRITER 0
161 #elif !defined(CYTHON_USE_UNICODE_WRITER)
162 #define CYTHON_USE_UNICODE_WRITER 1
164 #ifndef CYTHON_AVOID_BORROWED_REFS
165 #define CYTHON_AVOID_BORROWED_REFS 0
167 #ifndef CYTHON_ASSUME_SAFE_MACROS
168 #define CYTHON_ASSUME_SAFE_MACROS 1
170 #ifndef CYTHON_UNPACK_METHODS
171 #define CYTHON_UNPACK_METHODS 1
173 #ifndef CYTHON_FAST_THREAD_STATE
174 #define CYTHON_FAST_THREAD_STATE 1
176 #ifndef CYTHON_FAST_PYCALL
177 #define CYTHON_FAST_PYCALL 1
179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
182 #ifndef CYTHON_USE_TP_FINALIZE
183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
185 #ifndef CYTHON_USE_DICT_VERSIONS
186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
188 #ifndef CYTHON_USE_EXC_INFO_STACK
189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
195 #if CYTHON_USE_PYLONG_INTERNALS
196 #include "longintrepr.h"
201 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
204 #ifndef __has_attribute
205 #define __has_attribute(x) 0
207 #ifndef __has_cpp_attribute
208 #define __has_cpp_attribute(x) 0
210 #ifndef CYTHON_RESTRICT
211 #if defined(__GNUC__)
212 #define CYTHON_RESTRICT __restrict__
213 #elif defined(_MSC_VER) && _MSC_VER >= 1400
214 #define CYTHON_RESTRICT __restrict
215 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216 #define CYTHON_RESTRICT restrict
218 #define CYTHON_RESTRICT
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
226 # define CYTHON_UNUSED
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
231 # define CYTHON_UNUSED
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
250 #ifndef _MSC_STDINT_H_
252 typedef unsigned char uint8_t;
253 typedef unsigned int uint32_t;
255 typedef unsigned __int8 uint8_t;
256 typedef unsigned __int32 uint32_t;
262 #ifndef CYTHON_FALLTHROUGH
263 #if defined(__cplusplus) && __cplusplus >= 201103L
264 #if __has_cpp_attribute(fallthrough)
265 #define CYTHON_FALLTHROUGH [[fallthrough]]
266 #elif __has_cpp_attribute(clang::fallthrough)
267 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268 #elif __has_cpp_attribute(gnu::fallthrough)
269 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272 #ifndef CYTHON_FALLTHROUGH
273 #if __has_attribute(fallthrough)
274 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
276 #define CYTHON_FALLTHROUGH
279 #if defined(__clang__ ) && defined(__apple_build_version__)
280 #if __apple_build_version__ < 7000000
281 #undef CYTHON_FALLTHROUGH
282 #define CYTHON_FALLTHROUGH
288 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
290 #ifndef CYTHON_INLINE
291 #if defined(__clang__)
292 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
294 #define CYTHON_INLINE inline
298 void __Pyx_call_destructor(
T& x) {
302 class __Pyx_FakeReference {
304 __Pyx_FakeReference() : ptr(NULL) { }
305 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
306 T *operator->() {
return ptr; }
307 T *operator&() {
return ptr; }
308 operator T&() {
return *ptr; }
309 template<
typename U>
bool operator ==(
U other) {
return *ptr == other; }
310 template<
typename U>
bool operator !=(
U other) {
return *ptr != other; }
315 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
316 #define Py_OptimizeFlag 0
318 #define __PYX_BUILD_PY_SSIZE_T "n"
319 #define CYTHON_FORMAT_SSIZE_T "z"
320 #if PY_MAJOR_VERSION < 3
321 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
322 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
323 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
324 #define __Pyx_DefaultClassType PyClass_Type
326 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
327 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329 #define __Pyx_DefaultClassType PyType_Type
331 #ifndef Py_TPFLAGS_CHECKTYPES
332 #define Py_TPFLAGS_CHECKTYPES 0
334 #ifndef Py_TPFLAGS_HAVE_INDEX
335 #define Py_TPFLAGS_HAVE_INDEX 0
337 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
338 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
340 #ifndef Py_TPFLAGS_HAVE_FINALIZE
341 #define Py_TPFLAGS_HAVE_FINALIZE 0
343 #ifndef METH_STACKLESS
344 #define METH_STACKLESS 0
346 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
347 #ifndef METH_FASTCALL
348 #define METH_FASTCALL 0x80
350 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
351 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
352 Py_ssize_t nargs, PyObject *kwnames);
354 #define __Pyx_PyCFunctionFast _PyCFunctionFast
355 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
357 #if CYTHON_FAST_PYCCALL
358 #define __Pyx_PyFastCFunction_Check(func)\
359 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
361 #define __Pyx_PyFastCFunction_Check(func) 0
363 #if CYTHON_USE_DICT_VERSIONS
364 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
365 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
366 (version_var) = __PYX_GET_DICT_VERSION(dict);\
367 (cache_var) = (value);
368 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
369 static PY_UINT64_T __pyx_dict_version = 0;\
370 static PyObject *__pyx_dict_cached_value = NULL;\
371 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
372 (VAR) = __pyx_dict_cached_value;\
374 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
375 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
379 #define __PYX_GET_DICT_VERSION(dict) (0)
380 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
381 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
383 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
384 #define PyObject_Malloc(s) PyMem_Malloc(s)
385 #define PyObject_Free(p) PyMem_Free(p)
386 #define PyObject_Realloc(p) PyMem_Realloc(p)
388 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
389 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
390 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
391 #define PyMem_RawFree(p) PyMem_Free(p)
393 #if CYTHON_COMPILING_IN_PYSTON
394 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
395 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
397 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
398 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
400 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
401 #define __Pyx_PyThreadState_Current PyThreadState_GET()
402 #elif PY_VERSION_HEX >= 0x03060000
403 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
404 #elif PY_VERSION_HEX >= 0x03000000
405 #define __Pyx_PyThreadState_Current PyThreadState_GET()
407 #define __Pyx_PyThreadState_Current _PyThreadState_Current
409 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
410 #include "pythread.h"
411 #define Py_tss_NEEDS_INIT 0
412 typedef int Py_tss_t;
413 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
414 *key = PyThread_create_key();
417 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
418 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
419 *key = Py_tss_NEEDS_INIT;
422 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
425 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
426 return *key != Py_tss_NEEDS_INIT;
428 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
429 PyThread_delete_key(*key);
430 *key = Py_tss_NEEDS_INIT;
432 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
433 return PyThread_set_key_value(*key, value);
435 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
436 return PyThread_get_key_value(*key);
438 #endif // TSS (Thread Specific Storage) API
439 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
440 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
442 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
444 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
445 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
446 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
448 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
449 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
452 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
454 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
456 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
457 #define CYTHON_PEP393_ENABLED 1
458 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
459 0 : _PyUnicode_Ready((PyObject *)(op)))
460 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
461 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
462 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
463 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
464 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
465 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
466 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
467 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
469 #define CYTHON_PEP393_ENABLED 0
470 #define PyUnicode_1BYTE_KIND 1
471 #define PyUnicode_2BYTE_KIND 2
472 #define PyUnicode_4BYTE_KIND 4
473 #define __Pyx_PyUnicode_READY(op) (0)
474 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
475 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
476 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
477 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
478 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
479 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
480 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
481 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
483 #if CYTHON_COMPILING_IN_PYPY
484 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
485 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
487 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
488 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
489 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
491 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
492 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
494 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
495 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
497 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
498 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
500 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
501 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
502 #if PY_MAJOR_VERSION >= 3
503 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
505 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
507 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
508 #define PyObject_ASCII(o) PyObject_Repr(o)
510 #if PY_MAJOR_VERSION >= 3
511 #define PyBaseString_Type PyUnicode_Type
512 #define PyStringObject PyUnicodeObject
513 #define PyString_Type PyUnicode_Type
514 #define PyString_Check PyUnicode_Check
515 #define PyString_CheckExact PyUnicode_CheckExact
516 #define PyObject_Unicode PyObject_Str
518 #if PY_MAJOR_VERSION >= 3
519 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
520 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
522 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
523 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
525 #ifndef PySet_CheckExact
526 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
528 #if CYTHON_ASSUME_SAFE_MACROS
529 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
531 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
533 #if PY_MAJOR_VERSION >= 3
534 #define PyIntObject PyLongObject
535 #define PyInt_Type PyLong_Type
536 #define PyInt_Check(op) PyLong_Check(op)
537 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
538 #define PyInt_FromString PyLong_FromString
539 #define PyInt_FromUnicode PyLong_FromUnicode
540 #define PyInt_FromLong PyLong_FromLong
541 #define PyInt_FromSize_t PyLong_FromSize_t
542 #define PyInt_FromSsize_t PyLong_FromSsize_t
543 #define PyInt_AsLong PyLong_AsLong
544 #define PyInt_AS_LONG PyLong_AS_LONG
545 #define PyInt_AsSsize_t PyLong_AsSsize_t
546 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
547 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
548 #define PyNumber_Int PyNumber_Long
550 #if PY_MAJOR_VERSION >= 3
551 #define PyBoolObject PyLongObject
553 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
554 #ifndef PyUnicode_InternFromString
555 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
558 #if PY_VERSION_HEX < 0x030200A4
559 typedef long Py_hash_t;
560 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
561 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
563 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
564 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
566 #if PY_MAJOR_VERSION >= 3
567 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
569 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
571 #if CYTHON_USE_ASYNC_SLOTS
572 #if PY_VERSION_HEX >= 0x030500B1
573 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
574 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
576 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
579 #define __Pyx_PyType_AsAsync(obj) NULL
581 #ifndef __Pyx_PyAsyncMethodsStruct
586 } __Pyx_PyAsyncMethodsStruct;
589 #if defined(WIN32) || defined(MS_WINDOWS)
590 #define _USE_MATH_DEFINES
594 #define __PYX_NAN() ((float) NAN)
596 static CYTHON_INLINE
float __PYX_NAN() {
598 memset(&value, 0xFF,
sizeof(value));
602 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
603 #define __Pyx_truncl trunc
605 #define __Pyx_truncl truncl
609 #define __PYX_ERR(f_index, lineno, Ln_error) \
611 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
614 #ifndef __PYX_EXTERN_C
616 #define __PYX_EXTERN_C extern "C"
618 #define __PYX_EXTERN_C extern
622 #define __PYX_HAVE__BoundaryConditions
623 #define __PYX_HAVE_API__BoundaryConditions
627 #include "numpy/arrayobject.h"
628 #include "numpy/ufuncobject.h"
629 #include "pythread.h"
636 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
637 #define CYTHON_WITHOUT_ASSERTIONS
640 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
641 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
643 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
644 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
645 #define __PYX_DEFAULT_STRING_ENCODING ""
646 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
647 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
648 #define __Pyx_uchar_cast(c) ((unsigned char)c)
649 #define __Pyx_long_cast(x) ((long)x)
650 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
651 (sizeof(type) < sizeof(Py_ssize_t)) ||\
652 (sizeof(type) > sizeof(Py_ssize_t) &&\
653 likely(v < (type)PY_SSIZE_T_MAX ||\
654 v == (type)PY_SSIZE_T_MAX) &&\
655 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
656 v == (type)PY_SSIZE_T_MIN))) ||\
657 (sizeof(type) == sizeof(Py_ssize_t) &&\
658 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
659 v == (type)PY_SSIZE_T_MAX))) )
660 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
661 return (
size_t) i < (size_t) limit;
663 #if defined (__cplusplus) && __cplusplus >= 201103L
665 #define __Pyx_sst_abs(value) std::abs(value)
666 #elif SIZEOF_INT >= SIZEOF_SIZE_T
667 #define __Pyx_sst_abs(value) abs(value)
668 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
669 #define __Pyx_sst_abs(value) labs(value)
670 #elif defined (_MSC_VER)
671 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
672 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
673 #define __Pyx_sst_abs(value) llabs(value)
674 #elif defined (__GNUC__)
675 #define __Pyx_sst_abs(value) __builtin_llabs(value)
677 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
679 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
680 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
681 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
682 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
683 #define __Pyx_PyBytes_FromString PyBytes_FromString
684 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
685 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
686 #if PY_MAJOR_VERSION < 3
687 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
688 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
690 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
691 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
693 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
694 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
698 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
699 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
700 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
703 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
704 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
705 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
706 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
707 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
708 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
709 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
710 const Py_UNICODE *u_end =
u;
712 return (
size_t)(u_end -
u - 1);
714 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
715 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
716 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
717 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
718 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
719 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
720 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
721 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
722 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
723 #define __Pyx_PySequence_Tuple(obj)\
724 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
725 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
726 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
727 #if CYTHON_ASSUME_SAFE_MACROS
728 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
730 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
732 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
733 #if PY_MAJOR_VERSION >= 3
734 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
736 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
738 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
739 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
740 static int __Pyx_sys_getdefaultencoding_not_ascii;
741 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
743 PyObject* default_encoding = NULL;
744 PyObject* ascii_chars_u = NULL;
745 PyObject* ascii_chars_b = NULL;
746 const char* default_encoding_c;
747 sys = PyImport_ImportModule(
"sys");
749 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
751 if (!default_encoding)
goto bad;
752 default_encoding_c = PyBytes_AsString(default_encoding);
753 if (!default_encoding_c)
goto bad;
754 if (strcmp(default_encoding_c,
"ascii") == 0) {
755 __Pyx_sys_getdefaultencoding_not_ascii = 0;
757 char ascii_chars[128];
759 for (
c = 0;
c < 128;
c++) {
762 __Pyx_sys_getdefaultencoding_not_ascii = 1;
763 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
764 if (!ascii_chars_u)
goto bad;
765 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
766 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
769 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
773 Py_DECREF(ascii_chars_u);
774 Py_DECREF(ascii_chars_b);
776 Py_DECREF(default_encoding);
779 Py_XDECREF(default_encoding);
780 Py_XDECREF(ascii_chars_u);
781 Py_XDECREF(ascii_chars_b);
785 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
786 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
788 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
789 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
790 static char* __PYX_DEFAULT_STRING_ENCODING;
791 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
793 PyObject* default_encoding = NULL;
794 char* default_encoding_c;
795 sys = PyImport_ImportModule(
"sys");
797 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
799 if (!default_encoding)
goto bad;
800 default_encoding_c = PyBytes_AsString(default_encoding);
801 if (!default_encoding_c)
goto bad;
802 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
803 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
804 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
805 Py_DECREF(default_encoding);
808 Py_XDECREF(default_encoding);
816 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
817 #define likely(x) __builtin_expect(!!(x), 1)
818 #define unlikely(x) __builtin_expect(!!(x), 0)
820 #define likely(x) (x)
821 #define unlikely(x) (x)
823 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
825 static PyObject *__pyx_m = NULL;
826 static PyObject *__pyx_d;
827 static PyObject *__pyx_b;
828 static PyObject *__pyx_cython_runtime = NULL;
829 static PyObject *__pyx_empty_tuple;
830 static PyObject *__pyx_empty_bytes;
831 static PyObject *__pyx_empty_unicode;
832 static int __pyx_lineno;
833 static int __pyx_clineno = 0;
834 static const char * __pyx_cfilenm= __FILE__;
835 static const char *__pyx_filename;
838 #if !defined(CYTHON_CCOMPLEX)
839 #if defined(__cplusplus)
840 #define CYTHON_CCOMPLEX 1
841 #elif defined(_Complex_I)
842 #define CYTHON_CCOMPLEX 1
844 #define CYTHON_CCOMPLEX 0
854 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
856 #define _Complex_I 1.0fj
860 static const char *__pyx_f[] = {
861 "proteus/BoundaryConditions.py",
863 "proteus/BoundaryConditions.pxd",
864 "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd",
865 "linux/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd",
868 struct __pyx_memoryview_obj;
870 struct __pyx_memoryview_obj *memview;
873 Py_ssize_t strides[8];
874 Py_ssize_t suboffsets[8];
875 } __Pyx_memviewslice;
876 #define __Pyx_MemoryView_Len(m) (m.shape[0])
879 #include <pythread.h>
880 #ifndef CYTHON_ATOMICS
881 #define CYTHON_ATOMICS 1
883 #define __pyx_atomic_int_type int
884 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
885 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
887 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
888 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
889 #ifdef __PYX_DEBUG_ATOMICS
890 #warning "Using GNU atomics"
892 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
894 #undef __pyx_atomic_int_type
895 #define __pyx_atomic_int_type LONG
896 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
897 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
898 #ifdef __PYX_DEBUG_ATOMICS
899 #pragma message ("Using MSVC atomics")
901 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
902 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
903 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
904 #ifdef __PYX_DEBUG_ATOMICS
905 #warning "Using Intel atomics"
908 #undef CYTHON_ATOMICS
909 #define CYTHON_ATOMICS 0
910 #ifdef __PYX_DEBUG_ATOMICS
911 #warning "Not using atomics"
914 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
916 #define __pyx_add_acquisition_count(memview)\
917 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
918 #define __pyx_sub_acquisition_count(memview)\
919 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
921 #define __pyx_add_acquisition_count(memview)\
922 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
923 #define __pyx_sub_acquisition_count(memview)\
924 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
928 #ifndef __PYX_FORCE_INIT_THREADS
929 #define __PYX_FORCE_INIT_THREADS 0
933 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
934 #define __Pyx_PyGILState_Release PyGILState_Release
935 #define __Pyx_FastGIL_Remember()
936 #define __Pyx_FastGIL_Forget()
937 #define __Pyx_FastGilFuncInit()
940 #define IS_UNSIGNED(type) (((type) -1) > 0)
941 struct __Pyx_StructField_;
942 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
945 struct __Pyx_StructField_* fields;
953 typedef struct __Pyx_StructField_ {
954 __Pyx_TypeInfo* type;
959 __Pyx_StructField* field;
960 size_t parent_offset;
961 } __Pyx_BufFmt_StackElem;
963 __Pyx_StructField root;
964 __Pyx_BufFmt_StackElem* head;
966 size_t new_count, enc_count;
967 size_t struct_alignment;
973 } __Pyx_BufFmt_Context;
983 typedef npy_int8 __pyx_t_5numpy_int8_t;
992 typedef npy_int16 __pyx_t_5numpy_int16_t;
1001 typedef npy_int32 __pyx_t_5numpy_int32_t;
1010 typedef npy_int64 __pyx_t_5numpy_int64_t;
1019 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1028 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1037 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1046 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1055 typedef npy_float32 __pyx_t_5numpy_float32_t;
1064 typedef npy_float64 __pyx_t_5numpy_float64_t;
1073 typedef npy_long __pyx_t_5numpy_int_t;
1082 typedef npy_longlong __pyx_t_5numpy_long_t;
1091 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1100 typedef npy_ulong __pyx_t_5numpy_uint_t;
1109 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1118 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1127 typedef npy_intp __pyx_t_5numpy_intp_t;
1136 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1145 typedef npy_double __pyx_t_5numpy_float_t;
1154 typedef npy_double __pyx_t_5numpy_double_t;
1163 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1167 typedef ::std::complex< float > __pyx_t_float_complex;
1169 typedef float _Complex __pyx_t_float_complex;
1172 typedef struct {
float real, imag; } __pyx_t_float_complex;
1174 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1179 typedef ::std::complex< double > __pyx_t_double_complex;
1181 typedef double _Complex __pyx_t_double_complex;
1184 typedef struct {
double real, imag; } __pyx_t_double_complex;
1186 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1190 struct __pyx_obj_18BoundaryConditions_BC_Base;
1191 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1192 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1193 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1194 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
1195 struct __pyx_array_obj;
1196 struct __pyx_MemviewEnum_obj;
1197 struct __pyx_memoryview_obj;
1198 struct __pyx_memoryviewslice_obj;
1207 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1216 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1225 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1234 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1235 struct __pyx_defaults;
1236 typedef struct __pyx_defaults __pyx_defaults;
1237 struct __pyx_defaults1;
1238 typedef struct __pyx_defaults1 __pyx_defaults1;
1239 struct __pyx_defaults2;
1240 typedef struct __pyx_defaults2 __pyx_defaults2;
1249 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1250 struct __pyx_defaults {
1251 PyObject *__pyx_arg_n;
1253 struct __pyx_defaults1 {
1254 PyObject *__pyx_arg_n;
1256 struct __pyx_defaults2 {
1257 PyObject *__pyx_arg_n;
1267 struct __pyx_obj_18BoundaryConditions_BC_Base {
1269 __Pyx_memviewslice _b_or;
1285 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1287 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1288 __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1300 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1302 PyObject *__pyx_v_value;
1313 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1315 PyObject *__pyx_v_a;
1316 PyObject *__pyx_v_a0;
1327 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp {
1329 PyObject *__pyx_v_t1;
1330 PyObject *__pyx_v_value;
1341 struct __pyx_array_obj {
1343 struct __pyx_vtabstruct_array *__pyx_vtab;
1349 Py_ssize_t *_strides;
1350 Py_ssize_t itemsize;
1353 void (*callback_free_data)(
void *);
1355 int dtype_is_object;
1366 struct __pyx_MemviewEnum_obj {
1379 struct __pyx_memoryview_obj {
1381 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1384 PyObject *_array_interface;
1385 PyThread_type_lock lock;
1386 __pyx_atomic_int acquisition_count[2];
1387 __pyx_atomic_int *acquisition_count_aligned_p;
1390 int dtype_is_object;
1391 __Pyx_TypeInfo *typeinfo;
1402 struct __pyx_memoryviewslice_obj {
1403 struct __pyx_memoryview_obj __pyx_base;
1404 __Pyx_memviewslice from_slice;
1405 PyObject *from_object;
1406 PyObject *(*to_object_func)(
char *);
1407 int (*to_dtype_func)(
char *, PyObject *);
1420 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1421 void (*resetBC)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch);
1423 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1434 struct __pyx_vtabstruct_array {
1435 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1437 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1448 struct __pyx_vtabstruct_memoryview {
1449 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1450 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1451 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1452 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1453 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1454 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1455 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1457 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1468 struct __pyx_vtabstruct__memoryviewslice {
1469 struct __pyx_vtabstruct_memoryview __pyx_base;
1471 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1475 #ifndef CYTHON_REFNANNY
1476 #define CYTHON_REFNANNY 0
1480 void (*INCREF)(
void*, PyObject*, int);
1481 void (*DECREF)(
void*, PyObject*, int);
1482 void (*GOTREF)(
void*, PyObject*, int);
1483 void (*GIVEREF)(
void*, PyObject*, int);
1484 void* (*SetupContext)(
const char*, int,
const char*);
1485 void (*FinishContext)(
void**);
1486 } __Pyx_RefNannyAPIStruct;
1487 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1488 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1489 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1491 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1493 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1494 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1495 PyGILState_Release(__pyx_gilstate_save);\
1497 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1500 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1501 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1503 #define __Pyx_RefNannyFinishContext()\
1504 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1505 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1506 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1507 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1508 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1509 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1510 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1511 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1512 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1514 #define __Pyx_RefNannyDeclarations
1515 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1516 #define __Pyx_RefNannyFinishContext()
1517 #define __Pyx_INCREF(r) Py_INCREF(r)
1518 #define __Pyx_DECREF(r) Py_DECREF(r)
1519 #define __Pyx_GOTREF(r)
1520 #define __Pyx_GIVEREF(r)
1521 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1522 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1523 #define __Pyx_XGOTREF(r)
1524 #define __Pyx_XGIVEREF(r)
1526 #define __Pyx_XDECREF_SET(r, v) do {\
1527 PyObject *tmp = (PyObject *) r;\
1528 r = v; __Pyx_XDECREF(tmp);\
1530 #define __Pyx_DECREF_SET(r, v) do {\
1531 PyObject *tmp = (PyObject *) r;\
1532 r = v; __Pyx_DECREF(tmp);\
1534 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1535 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1538 #if CYTHON_USE_TYPE_SLOTS
1539 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1541 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1545 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1548 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1551 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1552 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1553 const char* function_name);
1556 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1557 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1560 #if CYTHON_FAST_THREAD_STATE
1561 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1562 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1563 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1565 #define __Pyx_PyThreadState_declare
1566 #define __Pyx_PyThreadState_assign
1567 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1571 #if CYTHON_FAST_THREAD_STATE
1572 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1573 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1574 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1575 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1576 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1577 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1578 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1579 #if CYTHON_COMPILING_IN_CPYTHON
1580 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1582 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1585 #define __Pyx_PyErr_Clear() PyErr_Clear()
1586 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1587 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1588 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1589 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1590 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1591 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1592 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1596 #ifndef CYTHON_PROFILE
1597 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1598 #define CYTHON_PROFILE 0
1600 #define CYTHON_PROFILE 1
1603 #ifndef CYTHON_TRACE_NOGIL
1604 #define CYTHON_TRACE_NOGIL 0
1606 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1607 #define CYTHON_TRACE 1
1610 #ifndef CYTHON_TRACE
1611 #define CYTHON_TRACE 0
1614 #undef CYTHON_PROFILE_REUSE_FRAME
1616 #ifndef CYTHON_PROFILE_REUSE_FRAME
1617 #define CYTHON_PROFILE_REUSE_FRAME 0
1619 #if CYTHON_PROFILE || CYTHON_TRACE
1620 #include "compile.h"
1621 #include "frameobject.h"
1622 #include "traceback.h"
1623 #if CYTHON_PROFILE_REUSE_FRAME
1624 #define CYTHON_FRAME_MODIFIER static
1625 #define CYTHON_FRAME_DEL(frame)
1627 #define CYTHON_FRAME_MODIFIER
1628 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1630 #define __Pyx_TraceDeclarations\
1631 static PyCodeObject *__pyx_frame_code = NULL;\
1632 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1633 int __Pyx_use_tracing = 0;
1634 #define __Pyx_TraceFrameInit(codeobj)\
1635 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1637 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1639 if (CYTHON_TRACE_NOGIL) {\
1640 PyThreadState *tstate;\
1641 PyGILState_STATE state = PyGILState_Ensure();\
1642 tstate = __Pyx_PyThreadState_Current;\
1643 if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1644 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1645 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1647 PyGILState_Release(state);\
1648 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1651 PyThreadState* tstate = PyThreadState_GET();\
1652 if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1653 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1654 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1655 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1659 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1660 { PyThreadState* tstate = PyThreadState_GET();\
1661 if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1662 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1663 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1664 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1668 #define __Pyx_TraceException()\
1669 if (likely(!__Pyx_use_tracing)); else {\
1670 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1671 if (tstate->use_tracing &&\
1672 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1674 tstate->use_tracing = 0;\
1675 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1677 if (CYTHON_TRACE && tstate->c_tracefunc)\
1678 tstate->c_tracefunc(\
1679 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1680 tstate->c_profilefunc(\
1681 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1682 Py_DECREF(exc_info);\
1684 tstate->use_tracing = 1;\
1688 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1689 PyObject *type, *value, *traceback;
1690 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1692 tstate->use_tracing = 0;
1693 if (CYTHON_TRACE && tstate->c_tracefunc)
1694 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1695 if (tstate->c_profilefunc)
1696 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1697 CYTHON_FRAME_DEL(frame);
1698 tstate->use_tracing = 1;
1700 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1703 #define __Pyx_TraceReturn(result, nogil)\
1704 if (likely(!__Pyx_use_tracing)); else {\
1706 if (CYTHON_TRACE_NOGIL) {\
1707 PyThreadState *tstate;\
1708 PyGILState_STATE state = PyGILState_Ensure();\
1709 tstate = __Pyx_PyThreadState_Current;\
1710 if (tstate->use_tracing) {\
1711 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1713 PyGILState_Release(state);\
1716 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1717 if (tstate->use_tracing) {\
1718 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1723 #define __Pyx_TraceReturn(result, nogil)\
1724 if (likely(!__Pyx_use_tracing)); else {\
1725 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1726 if (tstate->use_tracing) {\
1727 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1731 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1732 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1734 #define __Pyx_TraceDeclarations
1735 #define __Pyx_TraceFrameInit(codeobj)
1736 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1737 #define __Pyx_TraceException()
1738 #define __Pyx_TraceReturn(result, nogil)
1741 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1743 PyObject *type, *value, *traceback;
1744 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1745 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1747 tstate->use_tracing = 0;
1748 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1749 tstate->use_tracing = 1;
1752 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1756 Py_XDECREF(traceback);
1761 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1762 if (likely(!__Pyx_use_tracing)); else {\
1764 if (CYTHON_TRACE_NOGIL) {\
1766 PyThreadState *tstate;\
1767 PyGILState_STATE state = PyGILState_Ensure();\
1768 tstate = __Pyx_PyThreadState_Current;\
1769 if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1770 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1772 PyGILState_Release(state);\
1773 if (unlikely(ret)) goto_error;\
1776 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1777 if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1778 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1779 if (unlikely(ret)) goto_error;\
1784 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1785 if (likely(!__Pyx_use_tracing)); else {\
1786 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1787 if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1788 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1789 if (unlikely(ret)) goto_error;\
1794 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1798 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1799 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1800 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1801 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1802 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1803 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1804 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1805 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1806 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1807 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1808 int wraparound,
int boundscheck);
1809 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1810 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1811 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1812 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1813 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1814 int wraparound,
int boundscheck);
1815 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1816 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1817 int is_list,
int wraparound,
int boundscheck);
1820 #if CYTHON_USE_TYPE_SLOTS
1821 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1823 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1827 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1828 #define __Pyx_MEMVIEW_DIRECT 1
1829 #define __Pyx_MEMVIEW_PTR 2
1830 #define __Pyx_MEMVIEW_FULL 4
1831 #define __Pyx_MEMVIEW_CONTIG 8
1832 #define __Pyx_MEMVIEW_STRIDED 16
1833 #define __Pyx_MEMVIEW_FOLLOW 32
1834 #define __Pyx_IS_C_CONTIG 1
1835 #define __Pyx_IS_F_CONTIG 2
1836 static int __Pyx_init_memviewslice(
1837 struct __pyx_memoryview_obj *memview,
1839 __Pyx_memviewslice *memviewslice,
1840 int memview_is_new_reference);
1841 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1842 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1843 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1844 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1845 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1846 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1847 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1848 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1849 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1850 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1853 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1856 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1859 #if CYTHON_FAST_PYCALL
1860 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1861 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1862 #if 1 || PY_VERSION_HEX < 0x030600B1
1863 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1865 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1867 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1868 (sizeof(char [1 - 2*!(cond)]) - 1)
1869 #ifndef Py_MEMBER_SIZE
1870 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1872 static size_t __pyx_pyframe_localsplus_offset = 0;
1873 #include "frameobject.h"
1874 #define __Pxy_PyFrame_Initialize_Offsets()\
1875 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1876 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1877 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1878 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1882 #if CYTHON_COMPILING_IN_CPYTHON
1883 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1885 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1889 #if CYTHON_COMPILING_IN_CPYTHON
1890 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1894 #if CYTHON_COMPILING_IN_CPYTHON
1895 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1897 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1901 #if CYTHON_FAST_PYCCALL
1902 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1904 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1908 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1911 #if CYTHON_FAST_THREAD_STATE
1912 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1913 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1915 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1919 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1922 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1925 #if CYTHON_USE_DICT_VERSIONS
1926 #define __Pyx_GetModuleGlobalName(var, name) {\
1927 static PY_UINT64_T __pyx_dict_version = 0;\
1928 static PyObject *__pyx_dict_cached_value = NULL;\
1929 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1930 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1931 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1933 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1934 PY_UINT64_T __pyx_dict_version;\
1935 PyObject *__pyx_dict_cached_value;\
1936 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1938 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1940 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1941 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1942 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1946 static int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
1949 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1950 int lineno,
const char *filename,
1951 int full_traceback,
int nogil);
1954 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname);
1957 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1960 #define __Pyx_CyFunction_USED 1
1961 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1962 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1963 #define __Pyx_CYFUNCTION_CCLASS 0x04
1964 #define __Pyx_CyFunction_GetClosure(f)\
1965 (((__pyx_CyFunctionObject *) (f))->func_closure)
1966 #define __Pyx_CyFunction_GetClassObj(f)\
1967 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1968 #define __Pyx_CyFunction_Defaults(type, f)\
1969 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1970 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1971 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1973 PyCFunctionObject func;
1974 #if PY_VERSION_HEX < 0x030500A0
1975 PyObject *func_weakreflist;
1977 PyObject *func_dict;
1978 PyObject *func_name;
1979 PyObject *func_qualname;
1981 PyObject *func_globals;
1982 PyObject *func_code;
1983 PyObject *func_closure;
1984 PyObject *func_classobj;
1986 int defaults_pyobjects;
1988 PyObject *defaults_tuple;
1989 PyObject *defaults_kwdict;
1990 PyObject *(*defaults_getter)(PyObject *);
1991 PyObject *func_annotations;
1992 } __pyx_CyFunctionObject;
1993 static PyTypeObject *__pyx_CyFunctionType = 0;
1994 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1995 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
1996 __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
1997 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
1998 int flags, PyObject* qualname,
2000 PyObject *module, PyObject *globals,
2002 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2005 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2007 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2009 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2011 static int __pyx_CyFunction_init(
void);
2014 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
2017 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2018 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2019 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2020 int has_cstart,
int has_cstop,
int wraparound);
2023 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2026 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2029 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2030 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2031 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2032 (likely(PyDict_CheckExact(obj)) ?\
2033 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2035 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2036 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2040 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2043 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2046 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2049 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2052 #if CYTHON_USE_EXC_INFO_STACK
2053 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2057 #if CYTHON_FAST_THREAD_STATE
2058 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2059 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2060 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2061 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2063 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2064 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2068 #if CYTHON_FAST_THREAD_STATE
2069 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2070 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2072 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2076 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2077 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2078 __Pyx__ArgTypeTest(obj, type, name, exact))
2079 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2085 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
2088 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2091 #if PY_MAJOR_VERSION >= 3
2092 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2094 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2098 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2101 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2102 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2104 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2105 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2107 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
2109 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2111 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
2113 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2115 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
2117 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2121 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2122 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2123 const char* encoding,
const char* errors,
2124 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
2127 #if CYTHON_FAST_THREAD_STATE
2128 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2129 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2131 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2135 #if CYTHON_COMPILING_IN_CPYTHON
2136 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2137 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2138 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2139 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2141 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2142 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2143 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2145 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2147 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2149 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2150 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2151 PyListObject*
L = (PyListObject*) list;
2152 Py_ssize_t len = Py_SIZE(list);
2153 if (likely(
L->allocated > len)) {
2155 PyList_SET_ITEM(list, len, x);
2156 Py_SIZE(list) = len+1;
2159 return PyList_Append(list, x);
2162 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2166 #if !CYTHON_COMPILING_IN_PYPY
2167 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
2169 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
2170 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2174 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
2175 #if CYTHON_COMPILING_IN_CPYTHON
2176 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2177 if (unlikely(!none))
2182 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2187 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2188 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2189 PyListObject*
L = (PyListObject*) list;
2190 Py_ssize_t len = Py_SIZE(list);
2191 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
2193 PyList_SET_ITEM(list, len, x);
2194 Py_SIZE(list) = len+1;
2197 return PyList_Append(list, x);
2200 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2204 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2207 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
2210 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2211 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2213 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2217 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2218 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2220 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2224 static int __Pyx_setup_reduce(PyObject* type_obj);
2227 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2230 #ifndef __PYX_HAVE_RT_ImportType_proto
2231 #define __PYX_HAVE_RT_ImportType_proto
2232 enum __Pyx_ImportType_CheckSize {
2233 __Pyx_ImportType_CheckSize_Error = 0,
2234 __Pyx_ImportType_CheckSize_Warn = 1,
2235 __Pyx_ImportType_CheckSize_Ignore = 2
2237 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2241 #ifdef CYTHON_CLINE_IN_TRACEBACK
2242 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2244 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2249 PyCodeObject* code_object;
2251 } __Pyx_CodeObjectCacheEntry;
2252 struct __Pyx_CodeObjectCache {
2255 __Pyx_CodeObjectCacheEntry* entries;
2257 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2258 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2259 static PyCodeObject *__pyx_find_code_object(
int code_line);
2260 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2263 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2264 int py_line,
const char *filename);
2266 #if PY_MAJOR_VERSION < 3
2267 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2268 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2270 #define __Pyx_GetBuffer PyObject_GetBuffer
2271 #define __Pyx_ReleaseBuffer PyBuffer_Release
2277 Py_ssize_t shape, strides, suboffsets;
2278 } __Pyx_Buf_DimInfo;
2284 __Pyx_Buffer *rcbuffer;
2286 __Pyx_Buf_DimInfo diminfo[8];
2287 } __Pyx_LocalBuf_ND;
2290 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2293 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2294 __Pyx_memviewslice *slice2,
2295 int ndim,
size_t itemsize);
2298 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2301 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
2302 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj);
2305 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2308 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2309 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2310 __Pyx_BufFmt_StackElem* stack,
2311 __Pyx_TypeInfo* type);
2314 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2317 static int __Pyx_ValidateAndInit_memviewslice(
2322 __Pyx_TypeInfo *dtype,
2323 __Pyx_BufFmt_StackElem stack[],
2324 __Pyx_memviewslice *memviewslice,
2325 PyObject *original_obj);
2328 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2331 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2334 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2339 #define __Pyx_CREAL(z) ((z).real())
2340 #define __Pyx_CIMAG(z) ((z).imag())
2342 #define __Pyx_CREAL(z) (__real__(z))
2343 #define __Pyx_CIMAG(z) (__imag__(z))
2346 #define __Pyx_CREAL(z) ((z).real)
2347 #define __Pyx_CIMAG(z) ((z).imag)
2349 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2350 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2351 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2352 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2354 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2355 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2360 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2361 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2362 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2363 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2364 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2365 #define __Pyx_c_neg_float(a) (-(a))
2367 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2368 #define __Pyx_c_conj_float(z) (::std::conj(z))
2370 #define __Pyx_c_abs_float(z) (::std::abs(z))
2371 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2374 #define __Pyx_c_is_zero_float(z) ((z)==0)
2375 #define __Pyx_c_conj_float(z) (conjf(z))
2377 #define __Pyx_c_abs_float(z) (cabsf(z))
2378 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2382 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2383 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2384 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2385 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2386 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2387 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2388 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2389 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2391 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2392 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2398 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2399 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2400 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2401 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2402 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2403 #define __Pyx_c_neg_double(a) (-(a))
2405 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2406 #define __Pyx_c_conj_double(z) (::std::conj(z))
2408 #define __Pyx_c_abs_double(z) (::std::abs(z))
2409 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2412 #define __Pyx_c_is_zero_double(z) ((z)==0)
2413 #define __Pyx_c_conj_double(z) (conj(z))
2415 #define __Pyx_c_abs_double(z) (cabs(z))
2416 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2420 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2421 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2422 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2423 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2424 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2425 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2426 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2427 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2429 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2430 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2435 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
2438 static __Pyx_memviewslice
2439 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2440 const char *mode,
int ndim,
2441 size_t sizeof_dtype,
int contig_flag,
2442 int dtype_is_object);
2445 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2448 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2451 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2454 static int __Pyx_check_binary_version(
void);
2457 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2459 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch);
2460 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2461 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2462 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2463 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2464 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2465 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2466 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2467 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2468 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2469 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2484 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2497 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2498 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2499 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2500 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2501 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2502 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
2505 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2506 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2507 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2508 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2509 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
2510 static PyTypeObject *__pyx_array_type = 0;
2511 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2512 static PyTypeObject *__pyx_memoryview_type = 0;
2513 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2514 static PyObject *
generic = 0;
2515 static PyObject *strided = 0;
2516 static PyObject *indirect = 0;
2517 static PyObject *contiguous = 0;
2518 static PyObject *indirect_contiguous = 0;
2519 static int __pyx_memoryview_thread_locks_used;
2520 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2521 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *);
2522 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2523 static void *__pyx_align_pointer(
void *,
size_t);
2524 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2525 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2526 static PyObject *_unellipsify(PyObject *,
int);
2527 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2528 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2529 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2530 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2531 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2532 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2533 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2534 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2535 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2536 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2537 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2538 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2539 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2540 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2541 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2542 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2543 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2544 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2545 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2546 static int __pyx_memoryview_err(PyObject *,
char *);
2547 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2548 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2549 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2550 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2551 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2552 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2553 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2554 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2555 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2556 #define __Pyx_MODULE_NAME "BoundaryConditions"
2557 extern int __pyx_module_is_main_BoundaryConditions;
2558 int __pyx_module_is_main_BoundaryConditions = 0;
2561 static PyObject *__pyx_builtin_sum;
2562 static PyObject *__pyx_builtin_TypeError;
2563 static PyObject *__pyx_builtin_ValueError;
2564 static PyObject *__pyx_builtin_range;
2565 static PyObject *__pyx_builtin_RuntimeError;
2566 static PyObject *__pyx_builtin_ImportError;
2567 static PyObject *__pyx_builtin_MemoryError;
2568 static PyObject *__pyx_builtin_enumerate;
2569 static PyObject *__pyx_builtin_Ellipsis;
2570 static PyObject *__pyx_builtin_id;
2571 static PyObject *__pyx_builtin_IndexError;
2572 static const char __pyx_k_O[] =
"O";
2573 static const char __pyx_k_a[] =
"a";
2574 static const char __pyx_k_c[] =
"c";
2575 static const char __pyx_k_n[] =
"n";
2576 static const char __pyx_k_t[] =
"t";
2577 static const char __pyx_k_x[] =
"x";
2578 static const char __pyx_k_a0[] =
"a0";
2579 static const char __pyx_k_id[] =
"id";
2580 static const char __pyx_k_nd[] =
"nd";
2581 static const char __pyx_k_np[] =
"np";
2582 static const char __pyx_k_t1[] =
"t1";
2583 static const char __pyx_k_all[] =
"__all__";
2584 static const char __pyx_k_b_i[] =
"b_i";
2585 static const char __pyx_k_get[] =
"get";
2586 static const char __pyx_k_new[] =
"__new__";
2587 static const char __pyx_k_obj[] =
"obj";
2588 static const char __pyx_k_sum[] =
"sum";
2589 static const char __pyx_k_None[] =
"None";
2590 static const char __pyx_k_b_or[] =
"b_or";
2591 static const char __pyx_k_base[] =
"base";
2592 static const char __pyx_k_dict[] =
"__dict__";
2593 static const char __pyx_k_main[] =
"__main__";
2594 static const char __pyx_k_mode[] =
"mode";
2595 static const char __pyx_k_name[] =
"name";
2596 static const char __pyx_k_ndim[] =
"ndim";
2597 static const char __pyx_k_pack[] =
"pack";
2598 static const char __pyx_k_self[] =
"self";
2599 static const char __pyx_k_size[] =
"size";
2600 static const char __pyx_k_step[] =
"step";
2601 static const char __pyx_k_stop[] =
"stop";
2602 static const char __pyx_k_test[] =
"__test__";
2603 static const char __pyx_k_ASCII[] =
"ASCII";
2604 static const char __pyx_k_class[] =
"__class__";
2605 static const char __pyx_k_error[] =
"error";
2606 static const char __pyx_k_flags[] =
"flags";
2607 static const char __pyx_k_numpy[] =
"numpy";
2608 static const char __pyx_k_range[] =
"range";
2609 static const char __pyx_k_shape[] =
"shape";
2610 static const char __pyx_k_start[] =
"start";
2611 static const char __pyx_k_state[] =
"state";
2612 static const char __pyx_k_value[] =
"value";
2613 static const char __pyx_k_zeros[] =
"zeros";
2614 static const char __pyx_k_Domain[] =
"Domain";
2615 static const char __pyx_k_dict_2[] =
"_dict";
2616 static const char __pyx_k_encode[] =
"encode";
2617 static const char __pyx_k_format[] =
"format";
2618 static const char __pyx_k_import[] =
"__import__";
2619 static const char __pyx_k_name_2[] =
"__name__";
2620 static const char __pyx_k_pickle[] =
"pickle";
2621 static const char __pyx_k_reduce[] =
"__reduce__";
2622 static const char __pyx_k_struct[] =
"struct";
2623 static const char __pyx_k_unpack[] =
"unpack";
2624 static const char __pyx_k_update[] =
"update";
2625 static const char __pyx_k_BC_Base[] =
"BC_Base";
2626 static const char __pyx_k_Context[] =
"Context";
2627 static const char __pyx_k_context[] =
"context";
2628 static const char __pyx_k_fortran[] =
"fortran";
2629 static const char __pyx_k_memview[] =
"memview";
2630 static const char __pyx_k_proteus[] =
"proteus";
2631 static const char __pyx_k_resetBC[] =
"resetBC";
2632 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2633 static const char __pyx_k_getstate[] =
"__getstate__";
2634 static const char __pyx_k_itemsize[] =
"itemsize";
2635 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2636 static const char __pyx_k_setstate[] =
"__setstate__";
2637 static const char __pyx_k_TypeError[] =
"TypeError";
2638 static const char __pyx_k_enumerate[] =
"enumerate";
2639 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2640 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2641 static const char __pyx_k_IndexError[] =
"IndexError";
2642 static const char __pyx_k_ValueError[] =
"ValueError";
2643 static const char __pyx_k_getContext[] =
"getContext";
2644 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2645 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2646 static const char __pyx_k_ImportError[] =
"ImportError";
2647 static const char __pyx_k_MemoryError[] =
"MemoryError";
2648 static const char __pyx_k_PickleError[] =
"PickleError";
2649 static const char __pyx_k_init_cython[] =
"init_cython";
2650 static const char __pyx_k_setLinearBC[] =
"setLinearBC";
2651 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2652 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2653 static const char __pyx_k_stringsource[] =
"stringsource";
2654 static const char __pyx_k_use_setstate[] =
"use_setstate";
2655 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2656 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2657 static const char __pyx_k_setConstantBC[] =
"setConstantBC";
2658 static const char __pyx_k_setLinearRamp[] =
"setLinearRamp";
2659 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2660 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2661 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2662 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2663 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2664 static const char __pyx_k_BoundaryCondition[] =
"BoundaryCondition";
2665 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2666 static const char __pyx_k_BC_Base_getContext[] =
"BC_Base.getContext";
2667 static const char __pyx_k_BoundaryConditions[] =
"BoundaryConditions";
2668 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2669 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2670 static const char __pyx_k_pyx_unpickle_BC_Base[] =
"__pyx_unpickle_BC_Base";
2671 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2672 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2673 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2674 static const char __pyx_k_BC_Base___reduce_cython[] =
"BC_Base.__reduce_cython__";
2675 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2676 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2677 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2678 static const char __pyx_k_BC_Base___setstate_cython[] =
"BC_Base.__setstate_cython__";
2679 static const char __pyx_k_BoundaryCondition_resetBC[] =
"BoundaryCondition.resetBC";
2680 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2681 static const char __pyx_k_setLinearBC_locals_lambda[] =
"setLinearBC.<locals>.<lambda>";
2682 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2683 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
2684 static const char __pyx_k_setConstantBC_locals_lambda[] =
"setConstantBC.<locals>.<lambda>";
2685 static const char __pyx_k_setLinearRamp_locals_lambda[] =
"setLinearRamp.<locals>.<lambda>";
2686 static const char __pyx_k_BoundaryCondition_init_cython[] =
"BoundaryCondition.init_cython";
2687 static const char __pyx_k_BoundaryCondition_setLinearBC[] =
"BoundaryCondition.setLinearBC";
2688 static const char __pyx_k_proteus_BoundaryConditions_py[] =
"proteus/BoundaryConditions.py";
2689 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2690 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2691 static const char __pyx_k_BoundaryCondition_setConstantBC[] =
"BoundaryCondition.setConstantBC";
2692 static const char __pyx_k_BoundaryCondition_setLinearRamp[] =
"BoundaryCondition.setLinearRamp";
2693 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2694 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] =
"self.uuOfXT cannot be converted to a Python object for pickling";
2695 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
2696 static const char __pyx_k_BoundaryCondition___reduce_cytho[] =
"BoundaryCondition.__reduce_cython__";
2697 static const char __pyx_k_BoundaryCondition___setstate_cyt[] =
"BoundaryCondition.__setstate_cython__";
2698 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2699 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2700 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2701 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2702 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2703 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
2704 static const char __pyx_k_Incompatible_checksums_s_vs_0x96[] =
"Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))";
2705 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2706 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2707 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2708 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
2709 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2710 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] =
"Shape or nd must be passed to BC";
2711 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2712 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2713 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
2714 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2715 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2716 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2717 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
2718 static PyObject *__pyx_n_s_ASCII;
2719 static PyObject *__pyx_n_s_BC_Base;
2720 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2721 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2722 static PyObject *__pyx_n_s_BC_Base_getContext;
2723 static PyObject *__pyx_n_s_BoundaryCondition;
2724 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2725 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2726 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2727 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2728 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2729 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2730 static PyObject *__pyx_n_s_BoundaryCondition_setLinearRamp;
2731 static PyObject *__pyx_n_s_BoundaryConditions;
2732 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2733 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2734 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2735 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2736 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2737 static PyObject *__pyx_n_s_Context;
2738 static PyObject *__pyx_n_s_Domain;
2739 static PyObject *__pyx_n_s_Ellipsis;
2740 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2741 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2742 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2743 static PyObject *__pyx_n_s_ImportError;
2744 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x96;
2745 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2746 static PyObject *__pyx_n_s_IndexError;
2747 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2748 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2749 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2750 static PyObject *__pyx_n_s_MemoryError;
2751 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2752 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2753 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2754 static PyObject *__pyx_n_s_None;
2755 static PyObject *__pyx_n_b_O;
2756 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2757 static PyObject *__pyx_n_s_PickleError;
2758 static PyObject *__pyx_n_s_RuntimeError;
2759 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2760 static PyObject *__pyx_n_s_TypeError;
2761 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2762 static PyObject *__pyx_n_s_ValueError;
2763 static PyObject *__pyx_n_s_View_MemoryView;
2764 static PyObject *__pyx_n_s_a;
2765 static PyObject *__pyx_n_s_a0;
2766 static PyObject *__pyx_n_s_all;
2767 static PyObject *__pyx_n_s_allocate_buffer;
2768 static PyObject *__pyx_n_s_b_i;
2769 static PyObject *__pyx_n_s_b_or;
2770 static PyObject *__pyx_n_s_base;
2771 static PyObject *__pyx_n_s_c;
2772 static PyObject *__pyx_n_u_c;
2773 static PyObject *__pyx_n_s_class;
2774 static PyObject *__pyx_n_s_cline_in_traceback;
2775 static PyObject *__pyx_n_s_context;
2776 static PyObject *__pyx_kp_s_contiguous_and_direct;
2777 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2778 static PyObject *__pyx_n_s_dict;
2779 static PyObject *__pyx_n_s_dict_2;
2780 static PyObject *__pyx_n_s_dtype_is_object;
2781 static PyObject *__pyx_n_s_encode;
2782 static PyObject *__pyx_n_s_enumerate;
2783 static PyObject *__pyx_n_s_error;
2784 static PyObject *__pyx_n_s_flags;
2785 static PyObject *__pyx_n_s_format;
2786 static PyObject *__pyx_n_s_fortran;
2787 static PyObject *__pyx_n_u_fortran;
2788 static PyObject *__pyx_n_s_get;
2789 static PyObject *__pyx_n_s_getContext;
2790 static PyObject *__pyx_n_s_getstate;
2791 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2792 static PyObject *__pyx_n_s_id;
2793 static PyObject *__pyx_n_s_import;
2794 static PyObject *__pyx_n_s_init_cython;
2795 static PyObject *__pyx_n_s_itemsize;
2796 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2797 static PyObject *__pyx_n_s_main;
2798 static PyObject *__pyx_n_s_memview;
2799 static PyObject *__pyx_n_s_mode;
2800 static PyObject *__pyx_n_s_n;
2801 static PyObject *__pyx_n_s_name;
2802 static PyObject *__pyx_n_s_name_2;
2803 static PyObject *__pyx_n_s_nd;
2804 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2805 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2806 static PyObject *__pyx_n_s_ndim;
2807 static PyObject *__pyx_n_s_new;
2808 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2809 static PyObject *__pyx_n_s_np;
2810 static PyObject *__pyx_n_s_numpy;
2811 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2812 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2813 static PyObject *__pyx_n_s_obj;
2814 static PyObject *__pyx_n_s_pack;
2815 static PyObject *__pyx_n_s_pickle;
2816 static PyObject *__pyx_n_s_proteus;
2817 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2818 static PyObject *__pyx_n_s_pyx_PickleError;
2819 static PyObject *__pyx_n_s_pyx_checksum;
2820 static PyObject *__pyx_n_s_pyx_getbuffer;
2821 static PyObject *__pyx_n_s_pyx_result;
2822 static PyObject *__pyx_n_s_pyx_state;
2823 static PyObject *__pyx_n_s_pyx_type;
2824 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2825 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2826 static PyObject *__pyx_n_s_pyx_vtable;
2827 static PyObject *__pyx_n_s_range;
2828 static PyObject *__pyx_n_s_reduce;
2829 static PyObject *__pyx_n_s_reduce_cython;
2830 static PyObject *__pyx_n_s_reduce_ex;
2831 static PyObject *__pyx_n_s_resetBC;
2832 static PyObject *__pyx_n_s_self;
2833 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2834 static PyObject *__pyx_n_s_setConstantBC;
2835 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2836 static PyObject *__pyx_n_s_setLinearBC;
2837 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2838 static PyObject *__pyx_n_s_setLinearRamp;
2839 static PyObject *__pyx_n_s_setLinearRamp_locals_lambda;
2840 static PyObject *__pyx_n_s_setstate;
2841 static PyObject *__pyx_n_s_setstate_cython;
2842 static PyObject *__pyx_n_s_shape;
2843 static PyObject *__pyx_n_s_size;
2844 static PyObject *__pyx_n_s_start;
2845 static PyObject *__pyx_n_s_state;
2846 static PyObject *__pyx_n_s_step;
2847 static PyObject *__pyx_n_s_stop;
2848 static PyObject *__pyx_kp_s_strided_and_direct;
2849 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2850 static PyObject *__pyx_kp_s_strided_and_indirect;
2851 static PyObject *__pyx_kp_s_stringsource;
2852 static PyObject *__pyx_n_s_struct;
2853 static PyObject *__pyx_n_s_sum;
2854 static PyObject *__pyx_n_s_t;
2855 static PyObject *__pyx_n_s_t1;
2856 static PyObject *__pyx_n_s_test;
2857 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2858 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2859 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2860 static PyObject *__pyx_n_s_unpack;
2861 static PyObject *__pyx_n_s_update;
2862 static PyObject *__pyx_n_s_use_setstate;
2863 static PyObject *__pyx_n_s_value;
2864 static PyObject *__pyx_n_s_x;
2865 static PyObject *__pyx_n_s_zeros;
2866 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd);
2867 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context);
2868 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2869 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2870 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2871 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2872 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2873 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2874 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2875 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2876 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2877 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2878 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2879 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2880 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2881 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2882 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2883 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2884 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2885 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2886 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2887 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
2888 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
2889 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
2890 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
2891 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
2892 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a);
2893 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
2894 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
2895 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value);
2896 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2897 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
2898 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2899 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2900 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2901 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2902 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2903 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
2904 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2905 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2906 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2907 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2908 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2909 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2910 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2911 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2912 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2913 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2914 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2915 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2916 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2917 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2918 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2919 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2920 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2921 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2922 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2923 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2924 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2925 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2926 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2927 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2928 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2929 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2930 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2931 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2932 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2933 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2934 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2935 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2936 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2937 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2938 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2939 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2940 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2941 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2942 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2943 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2944 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2945 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2946 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k);
2947 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k);
2948 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k);
2949 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k);
2950 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, PyObject *a, PyObject *k);
2951 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2952 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2953 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2954 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2955 static PyObject *__pyx_int_0;
2956 static PyObject *__pyx_int_1;
2957 static PyObject *__pyx_int_3;
2958 static PyObject *__pyx_int_158231071;
2959 static PyObject *__pyx_int_184977713;
2960 static PyObject *__pyx_int_neg_1;
2961 static PyObject *__pyx_codeobj_;
2962 static PyObject *__pyx_slice__7;
2963 static PyObject *__pyx_tuple__11;
2964 static PyObject *__pyx_tuple__13;
2965 static PyObject *__pyx_tuple__15;
2966 static PyObject *__pyx_tuple__16;
2967 static PyObject *__pyx_tuple__17;
2968 static PyObject *__pyx_tuple__18;
2969 static PyObject *__pyx_tuple__19;
2970 static PyObject *__pyx_tuple__20;
2971 static PyObject *__pyx_tuple__21;
2972 static PyObject *__pyx_tuple__22;
2973 static PyObject *__pyx_tuple__23;
2974 static PyObject *__pyx_tuple__24;
2975 static PyObject *__pyx_tuple__25;
2976 static PyObject *__pyx_tuple__26;
2977 static PyObject *__pyx_tuple__27;
2978 static PyObject *__pyx_tuple__28;
2979 static PyObject *__pyx_tuple__29;
2980 static PyObject *__pyx_tuple__30;
2981 static PyObject *__pyx_tuple__31;
2982 static PyObject *__pyx_tuple__32;
2983 static PyObject *__pyx_tuple__33;
2984 static PyObject *__pyx_tuple__34;
2985 static PyObject *__pyx_tuple__35;
2986 static PyObject *__pyx_tuple__36;
2987 static PyObject *__pyx_tuple__37;
2988 static PyObject *__pyx_tuple__38;
2989 static PyObject *__pyx_tuple__40;
2990 static PyObject *__pyx_tuple__41;
2991 static PyObject *__pyx_tuple__42;
2992 static PyObject *__pyx_tuple__43;
2993 static PyObject *__pyx_tuple__44;
2994 static PyObject *__pyx_tuple__45;
2995 static PyObject *__pyx_tuple__46;
2996 static PyObject *__pyx_tuple__47;
2997 static PyObject *__pyx_tuple__48;
2998 static PyObject *__pyx_tuple__49;
2999 static PyObject *__pyx_tuple__50;
3000 static PyObject *__pyx_tuple__51;
3001 static PyObject *__pyx_tuple__52;
3002 static PyObject *__pyx_tuple__53;
3003 static PyObject *__pyx_tuple__54;
3004 static PyObject *__pyx_tuple__55;
3005 static PyObject *__pyx_tuple__56;
3006 static PyObject *__pyx_codeobj__2;
3007 static PyObject *__pyx_codeobj__3;
3008 static PyObject *__pyx_codeobj__4;
3009 static PyObject *__pyx_codeobj__5;
3010 static PyObject *__pyx_codeobj__6;
3011 static PyObject *__pyx_codeobj__8;
3012 static PyObject *__pyx_codeobj__9;
3013 static PyObject *__pyx_codeobj__10;
3014 static PyObject *__pyx_codeobj__12;
3015 static PyObject *__pyx_codeobj__14;
3016 static PyObject *__pyx_codeobj__39;
3028 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3029 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3030 PyObject *__pyx_v_shape = 0;
3031 PyObject *__pyx_v_name = 0;
3032 PyObject *__pyx_v_b_or = 0;
3033 PyObject *__pyx_v_b_i = 0;
3034 PyObject *__pyx_v_nd = 0;
3036 __Pyx_RefNannyDeclarations
3037 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3039 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
3040 PyObject* values[5] = {0,0,0,0,0};
3041 values[0] = ((PyObject *)Py_None);
3042 values[1] = ((PyObject *)Py_None);
3043 values[2] = ((PyObject *)Py_None);
3044 values[3] = ((PyObject *)__pyx_int_0);
3045 values[4] = ((PyObject *)Py_None);
3046 if (unlikely(__pyx_kwds)) {
3048 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3050 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3052 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3054 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3056 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3058 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3061 default:
goto __pyx_L5_argtuple_error;
3063 kw_args = PyDict_Size(__pyx_kwds);
3067 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
3068 if (value) { values[0] = value; kw_args--; }
3073 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
3074 if (value) { values[1] = value; kw_args--; }
3079 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
3080 if (value) { values[2] = value; kw_args--; }
3085 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
3086 if (value) { values[3] = value; kw_args--; }
3091 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
3092 if (value) { values[4] = value; kw_args--; }
3095 if (unlikely(kw_args > 0)) {
3096 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 24, __pyx_L3_error)
3099 switch (PyTuple_GET_SIZE(__pyx_args)) {
3100 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3102 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3104 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3106 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3108 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3111 default:
goto __pyx_L5_argtuple_error;
3114 __pyx_v_shape = values[0];
3115 __pyx_v_name = values[1];
3116 __pyx_v_b_or = values[2];
3117 __pyx_v_b_i = values[3];
3118 __pyx_v_nd = values[4];
3120 goto __pyx_L4_argument_unpacking_done;
3121 __pyx_L5_argtuple_error:;
3122 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 24, __pyx_L3_error)
3124 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3125 __Pyx_RefNannyFinishContext();
3127 __pyx_L4_argument_unpacking_done:;
3128 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
3131 __Pyx_RefNannyFinishContext();
3135 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
3137 __Pyx_TraceDeclarations
3138 __Pyx_RefNannyDeclarations
3139 PyObject *__pyx_t_1 = NULL;
3142 PyObject *__pyx_t_4 = NULL;
3144 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3145 __Pyx_RefNannySetupContext(
"__init__", 0);
3146 __Pyx_TraceCall(
"__init__", __pyx_f[0], 24, 0, __PYX_ERR(0, 24, __pyx_L1_error));
3155 __Pyx_INCREF(__pyx_v_shape);
3156 __Pyx_GIVEREF(__pyx_v_shape);
3157 __Pyx_GOTREF(__pyx_v_self->Shape);
3158 __Pyx_DECREF(__pyx_v_self->Shape);
3159 __pyx_v_self->Shape = __pyx_v_shape;
3168 if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 26, __pyx_L1_error)
3169 __pyx_t_1 = __pyx_v_name;
3170 __Pyx_INCREF(__pyx_t_1);
3171 __Pyx_GIVEREF(__pyx_t_1);
3172 __Pyx_GOTREF(__pyx_v_self->name);
3173 __Pyx_DECREF(__pyx_v_self->name);
3174 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3184 __Pyx_INCREF(__pyx_n_s_None);
3185 __Pyx_GIVEREF(__pyx_n_s_None);
3186 __Pyx_GOTREF(__pyx_v_self->BC_type);
3187 __Pyx_DECREF(__pyx_v_self->BC_type);
3188 __pyx_v_self->BC_type = __pyx_n_s_None;
3197 __pyx_t_2 = (__pyx_v_shape != Py_None);
3198 __pyx_t_3 = (__pyx_t_2 != 0);
3208 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3209 __Pyx_GOTREF(__pyx_t_1);
3210 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
3211 __Pyx_GOTREF(__pyx_t_4);
3212 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3213 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3214 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3215 __pyx_v_self->nd = __pyx_t_5;
3234 __pyx_t_3 = (__pyx_v_nd != Py_None);
3235 __pyx_t_2 = (__pyx_t_3 != 0);
3245 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3246 __pyx_v_self->nd = __pyx_t_5;
3266 #ifndef CYTHON_WITHOUT_ASSERTIONS
3267 if (unlikely(!Py_OptimizeFlag)) {
3268 __pyx_t_2 = (__pyx_v_nd != Py_None);
3269 if (unlikely(!(__pyx_t_2 != 0))) {
3270 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
3271 __PYX_ERR(0, 33, __pyx_L1_error)
3285 __pyx_t_2 = (__pyx_v_b_or != Py_None);
3286 __pyx_t_3 = (__pyx_t_2 != 0);
3296 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
3297 __Pyx_GOTREF(__pyx_t_4);
3298 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 35, __pyx_L1_error)
3299 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3300 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3301 __pyx_v_self->_b_or = __pyx_t_6;
3302 __pyx_t_6.memview = NULL;
3303 __pyx_t_6.data = NULL;
3323 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 37, __pyx_L1_error)
3324 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3325 __pyx_v_self->_b_or = __pyx_t_6;
3326 __pyx_t_6.memview = NULL;
3327 __pyx_t_6.data = NULL;
3343 __Pyx_XDECREF(__pyx_t_1);
3344 __Pyx_XDECREF(__pyx_t_4);
3345 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3346 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3349 __Pyx_TraceReturn(Py_None, 0);
3350 __Pyx_RefNannyFinishContext();
3363 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3364 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] =
"BC_Base.getContext(self, context=None)\n\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
3365 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {
"getContext", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
3366 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3367 PyObject *__pyx_v_context = 0;
3368 PyObject *__pyx_r = 0;
3369 __Pyx_RefNannyDeclarations
3370 __Pyx_RefNannySetupContext(
"getContext (wrapper)", 0);
3372 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3373 PyObject* values[1] = {0};
3374 values[0] = ((PyObject *)Py_None);
3375 if (unlikely(__pyx_kwds)) {
3377 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3379 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3382 default:
goto __pyx_L5_argtuple_error;
3384 kw_args = PyDict_Size(__pyx_kwds);
3388 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3389 if (value) { values[0] = value; kw_args--; }
3392 if (unlikely(kw_args > 0)) {
3393 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getContext") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3396 switch (PyTuple_GET_SIZE(__pyx_args)) {
3397 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3400 default:
goto __pyx_L5_argtuple_error;
3403 __pyx_v_context = values[0];
3405 goto __pyx_L4_argument_unpacking_done;
3406 __pyx_L5_argtuple_error:;
3407 __Pyx_RaiseArgtupleInvalid(
"getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3409 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3410 __Pyx_RefNannyFinishContext();
3412 __pyx_L4_argument_unpacking_done:;
3413 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3416 __Pyx_RefNannyFinishContext();
3420 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3421 PyObject *__pyx_v_Context = NULL;
3422 PyObject *__pyx_r = NULL;
3423 __Pyx_TraceDeclarations
3424 __Pyx_RefNannyDeclarations
3426 PyObject *__pyx_t_2 = NULL;
3427 PyObject *__pyx_t_3 = NULL;
3428 PyObject *__pyx_t_4 = NULL;
3429 __Pyx_TraceFrameInit(__pyx_codeobj_)
3430 __Pyx_RefNannySetupContext(
"getContext", 0);
3431 __Pyx_TraceCall(
"getContext", __pyx_f[0], 52, 0, __PYX_ERR(0, 52, __pyx_L1_error));
3440 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3450 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3451 __Pyx_GOTREF(__pyx_t_2);
3452 __Pyx_INCREF(__pyx_n_s_Context);
3453 __Pyx_GIVEREF(__pyx_n_s_Context);
3454 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3455 __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
3456 __Pyx_GOTREF(__pyx_t_3);
3457 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3458 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3459 __Pyx_GOTREF(__pyx_t_2);
3460 __Pyx_INCREF(__pyx_t_2);
3461 __pyx_v_Context = __pyx_t_2;
3462 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3463 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3472 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3473 __Pyx_GOTREF(__pyx_t_2);
3475 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3476 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3477 if (likely(__pyx_t_4)) {
3478 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3479 __Pyx_INCREF(__pyx_t_4);
3480 __Pyx_INCREF(
function);
3481 __Pyx_DECREF_SET(__pyx_t_2,
function);
3484 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3485 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3486 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
3487 __Pyx_GOTREF(__pyx_t_3);
3488 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3489 __Pyx_GIVEREF(__pyx_t_3);
3490 __Pyx_GOTREF(__pyx_v_self->ct);
3491 __Pyx_DECREF(__pyx_v_self->ct);
3492 __pyx_v_self->ct = __pyx_t_3;
3513 __Pyx_INCREF(__pyx_v_context);
3514 __Pyx_GIVEREF(__pyx_v_context);
3515 __Pyx_GOTREF(__pyx_v_self->ct);
3516 __Pyx_DECREF(__pyx_v_self->ct);
3517 __pyx_v_self->ct = __pyx_v_context;
3530 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3533 __Pyx_XDECREF(__pyx_t_2);
3534 __Pyx_XDECREF(__pyx_t_3);
3535 __Pyx_XDECREF(__pyx_t_4);
3536 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3539 __Pyx_XDECREF(__pyx_v_Context);
3540 __Pyx_XGIVEREF(__pyx_r);
3541 __Pyx_TraceReturn(__pyx_r, 0);
3542 __Pyx_RefNannyFinishContext();
3555 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self);
3556 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3557 PyObject *__pyx_r = 0;
3558 __Pyx_RefNannyDeclarations
3559 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3560 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3563 __Pyx_RefNannyFinishContext();
3567 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3568 PyObject *__pyx_r = NULL;
3569 __Pyx_TraceDeclarations
3570 __Pyx_RefNannyDeclarations
3571 PyObject *__pyx_t_1 = NULL;
3572 __Pyx_RefNannySetupContext(
"__get__", 0);
3573 __Pyx_TraceCall(
"__get__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3574 __Pyx_XDECREF(__pyx_r);
3575 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3576 __Pyx_GOTREF(__pyx_t_1);
3577 __pyx_r = __pyx_t_1;
3583 __Pyx_XDECREF(__pyx_t_1);
3584 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3587 __Pyx_XGIVEREF(__pyx_r);
3588 __Pyx_TraceReturn(__pyx_r, 0);
3589 __Pyx_RefNannyFinishContext();
3594 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3595 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3597 __Pyx_RefNannyDeclarations
3598 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3599 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3602 __Pyx_RefNannyFinishContext();
3606 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3608 __Pyx_TraceDeclarations
3609 __Pyx_RefNannyDeclarations
3611 __Pyx_RefNannySetupContext(
"__set__", 0);
3612 __Pyx_TraceCall(
"__set__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3613 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3614 __pyx_v_self->nd = __pyx_t_1;
3620 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3623 __Pyx_TraceReturn(Py_None, 0);
3624 __Pyx_RefNannyFinishContext();
3637 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self);
3638 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3639 PyObject *__pyx_r = 0;
3640 __Pyx_RefNannyDeclarations
3641 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3642 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3645 __Pyx_RefNannyFinishContext();
3649 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3650 PyObject *__pyx_r = NULL;
3651 __Pyx_TraceDeclarations
3652 __Pyx_RefNannyDeclarations
3653 __Pyx_RefNannySetupContext(
"__get__", 0);
3654 __Pyx_TraceCall(
"__get__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3655 __Pyx_XDECREF(__pyx_r);
3656 __Pyx_INCREF(__pyx_v_self->Shape);
3657 __pyx_r = __pyx_v_self->Shape;
3662 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3665 __Pyx_XGIVEREF(__pyx_r);
3666 __Pyx_TraceReturn(__pyx_r, 0);
3667 __Pyx_RefNannyFinishContext();
3672 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3673 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3675 __Pyx_RefNannyDeclarations
3676 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3677 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3680 __Pyx_RefNannyFinishContext();
3684 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3686 __Pyx_TraceDeclarations
3687 __Pyx_RefNannyDeclarations
3688 __Pyx_RefNannySetupContext(
"__set__", 0);
3689 __Pyx_TraceCall(
"__set__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3690 __Pyx_INCREF(__pyx_v_value);
3691 __Pyx_GIVEREF(__pyx_v_value);
3692 __Pyx_GOTREF(__pyx_v_self->Shape);
3693 __Pyx_DECREF(__pyx_v_self->Shape);
3694 __pyx_v_self->Shape = __pyx_v_value;
3700 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3703 __Pyx_TraceReturn(Py_None, 0);
3704 __Pyx_RefNannyFinishContext();
3709 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self);
3710 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3712 __Pyx_RefNannyDeclarations
3713 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3714 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3717 __Pyx_RefNannyFinishContext();
3721 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3723 __Pyx_TraceDeclarations
3724 __Pyx_RefNannyDeclarations
3725 __Pyx_RefNannySetupContext(
"__del__", 0);
3726 __Pyx_TraceCall(
"__del__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3727 __Pyx_INCREF(Py_None);
3728 __Pyx_GIVEREF(Py_None);
3729 __Pyx_GOTREF(__pyx_v_self->Shape);
3730 __Pyx_DECREF(__pyx_v_self->Shape);
3731 __pyx_v_self->Shape = Py_None;
3737 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3740 __Pyx_TraceReturn(Py_None, 0);
3741 __Pyx_RefNannyFinishContext();
3754 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self);
3755 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3756 PyObject *__pyx_r = 0;
3757 __Pyx_RefNannyDeclarations
3758 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3759 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3762 __Pyx_RefNannyFinishContext();
3766 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3767 PyObject *__pyx_r = NULL;
3768 __Pyx_TraceDeclarations
3769 __Pyx_RefNannyDeclarations
3770 __Pyx_RefNannySetupContext(
"__get__", 0);
3771 __Pyx_TraceCall(
"__get__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3772 __Pyx_XDECREF(__pyx_r);
3773 __Pyx_INCREF(__pyx_v_self->name);
3774 __pyx_r = __pyx_v_self->name;
3779 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3782 __Pyx_XGIVEREF(__pyx_r);
3783 __Pyx_TraceReturn(__pyx_r, 0);
3784 __Pyx_RefNannyFinishContext();
3789 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3790 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3792 __Pyx_RefNannyDeclarations
3793 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3794 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3797 __Pyx_RefNannyFinishContext();
3801 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3803 __Pyx_TraceDeclarations
3804 __Pyx_RefNannyDeclarations
3805 PyObject *__pyx_t_1 = NULL;
3806 __Pyx_RefNannySetupContext(
"__set__", 0);
3807 __Pyx_TraceCall(
"__set__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3808 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3809 __pyx_t_1 = __pyx_v_value;
3810 __Pyx_INCREF(__pyx_t_1);
3811 __Pyx_GIVEREF(__pyx_t_1);
3812 __Pyx_GOTREF(__pyx_v_self->name);
3813 __Pyx_DECREF(__pyx_v_self->name);
3814 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3821 __Pyx_XDECREF(__pyx_t_1);
3822 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3825 __Pyx_TraceReturn(Py_None, 0);
3826 __Pyx_RefNannyFinishContext();
3831 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self);
3832 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
3834 __Pyx_RefNannyDeclarations
3835 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3836 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3839 __Pyx_RefNannyFinishContext();
3843 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3845 __Pyx_TraceDeclarations
3846 __Pyx_RefNannyDeclarations
3847 __Pyx_RefNannySetupContext(
"__del__", 0);
3848 __Pyx_TraceCall(
"__del__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3849 __Pyx_INCREF(Py_None);
3850 __Pyx_GIVEREF(Py_None);
3851 __Pyx_GOTREF(__pyx_v_self->name);
3852 __Pyx_DECREF(__pyx_v_self->name);
3853 __pyx_v_self->name = ((PyObject*)Py_None);
3859 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3862 __Pyx_TraceReturn(Py_None, 0);
3863 __Pyx_RefNannyFinishContext();
3876 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self);
3877 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
3878 PyObject *__pyx_r = 0;
3879 __Pyx_RefNannyDeclarations
3880 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3881 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3884 __Pyx_RefNannyFinishContext();
3888 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3889 PyObject *__pyx_r = NULL;
3890 __Pyx_TraceDeclarations
3891 __Pyx_RefNannyDeclarations
3892 __Pyx_RefNannySetupContext(
"__get__", 0);
3893 __Pyx_TraceCall(
"__get__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
3894 __Pyx_XDECREF(__pyx_r);
3895 __Pyx_INCREF(__pyx_v_self->BC_type);
3896 __pyx_r = __pyx_v_self->BC_type;
3901 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3904 __Pyx_XGIVEREF(__pyx_r);
3905 __Pyx_TraceReturn(__pyx_r, 0);
3906 __Pyx_RefNannyFinishContext();
3911 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3912 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3914 __Pyx_RefNannyDeclarations
3915 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3916 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3919 __Pyx_RefNannyFinishContext();
3923 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3925 __Pyx_TraceDeclarations
3926 __Pyx_RefNannyDeclarations
3927 PyObject *__pyx_t_1 = NULL;
3928 __Pyx_RefNannySetupContext(
"__set__", 0);
3929 __Pyx_TraceCall(
"__set__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
3930 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
3931 __pyx_t_1 = __pyx_v_value;
3932 __Pyx_INCREF(__pyx_t_1);
3933 __Pyx_GIVEREF(__pyx_t_1);
3934 __Pyx_GOTREF(__pyx_v_self->BC_type);
3935 __Pyx_DECREF(__pyx_v_self->BC_type);
3936 __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
3943 __Pyx_XDECREF(__pyx_t_1);
3944 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3947 __Pyx_TraceReturn(Py_None, 0);
3948 __Pyx_RefNannyFinishContext();
3953 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self);
3954 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
3956 __Pyx_RefNannyDeclarations
3957 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3958 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3961 __Pyx_RefNannyFinishContext();
3965 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3967 __Pyx_TraceDeclarations
3968 __Pyx_RefNannyDeclarations
3969 __Pyx_RefNannySetupContext(
"__del__", 0);
3970 __Pyx_TraceCall(
"__del__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
3971 __Pyx_INCREF(Py_None);
3972 __Pyx_GIVEREF(Py_None);
3973 __Pyx_GOTREF(__pyx_v_self->BC_type);
3974 __Pyx_DECREF(__pyx_v_self->BC_type);
3975 __pyx_v_self->BC_type = ((PyObject*)Py_None);
3981 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3984 __Pyx_TraceReturn(Py_None, 0);
3985 __Pyx_RefNannyFinishContext();
3998 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self);
3999 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
4000 PyObject *__pyx_r = 0;
4001 __Pyx_RefNannyDeclarations
4002 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4003 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4006 __Pyx_RefNannyFinishContext();
4010 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4011 PyObject *__pyx_r = NULL;
4012 __Pyx_TraceDeclarations
4013 __Pyx_RefNannyDeclarations
4014 __Pyx_RefNannySetupContext(
"__get__", 0);
4015 __Pyx_TraceCall(
"__get__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4016 __Pyx_XDECREF(__pyx_r);
4017 __Pyx_INCREF(__pyx_v_self->ct);
4018 __pyx_r = __pyx_v_self->ct;
4023 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4026 __Pyx_XGIVEREF(__pyx_r);
4027 __Pyx_TraceReturn(__pyx_r, 0);
4028 __Pyx_RefNannyFinishContext();
4033 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4034 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4036 __Pyx_RefNannyDeclarations
4037 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
4038 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4041 __Pyx_RefNannyFinishContext();
4045 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4047 __Pyx_TraceDeclarations
4048 __Pyx_RefNannyDeclarations
4049 __Pyx_RefNannySetupContext(
"__set__", 0);
4050 __Pyx_TraceCall(
"__set__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4051 __Pyx_INCREF(__pyx_v_value);
4052 __Pyx_GIVEREF(__pyx_v_value);
4053 __Pyx_GOTREF(__pyx_v_self->ct);
4054 __Pyx_DECREF(__pyx_v_self->ct);
4055 __pyx_v_self->ct = __pyx_v_value;
4061 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4064 __Pyx_TraceReturn(Py_None, 0);
4065 __Pyx_RefNannyFinishContext();
4070 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self);
4071 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
4073 __Pyx_RefNannyDeclarations
4074 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
4075 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4078 __Pyx_RefNannyFinishContext();
4082 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4084 __Pyx_TraceDeclarations
4085 __Pyx_RefNannyDeclarations
4086 __Pyx_RefNannySetupContext(
"__del__", 0);
4087 __Pyx_TraceCall(
"__del__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4088 __Pyx_INCREF(Py_None);
4089 __Pyx_GIVEREF(Py_None);
4090 __Pyx_GOTREF(__pyx_v_self->ct);
4091 __Pyx_DECREF(__pyx_v_self->ct);
4092 __pyx_v_self->ct = Py_None;
4098 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4101 __Pyx_TraceReturn(Py_None, 0);
4102 __Pyx_RefNannyFinishContext();
4113 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4114 static char __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__[] =
"BC_Base.__reduce_cython__(self)";
4115 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__};
4116 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4117 PyObject *__pyx_r = 0;
4118 __Pyx_RefNannyDeclarations
4119 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
4120 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4123 __Pyx_RefNannyFinishContext();
4127 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4128 PyObject *__pyx_v_state = 0;
4129 PyObject *__pyx_v__dict = 0;
4130 int __pyx_v_use_setstate;
4131 PyObject *__pyx_r = NULL;
4132 __Pyx_TraceDeclarations
4133 __Pyx_RefNannyDeclarations
4134 PyObject *__pyx_t_1 = NULL;
4135 PyObject *__pyx_t_2 = NULL;
4136 PyObject *__pyx_t_3 = NULL;
4140 __Pyx_TraceFrameInit(__pyx_codeobj__2)
4141 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
4142 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
4151 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4152 __Pyx_GOTREF(__pyx_t_1);
4153 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4154 __Pyx_GOTREF(__pyx_t_2);
4155 __pyx_t_3 = PyTuple_New(6);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
4156 __Pyx_GOTREF(__pyx_t_3);
4157 __Pyx_INCREF(__pyx_v_self->BC_type);
4158 __Pyx_GIVEREF(__pyx_v_self->BC_type);
4159 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
4160 __Pyx_INCREF(__pyx_v_self->Shape);
4161 __Pyx_GIVEREF(__pyx_v_self->Shape);
4162 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
4163 __Pyx_GIVEREF(__pyx_t_1);
4164 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
4165 __Pyx_INCREF(__pyx_v_self->ct);
4166 __Pyx_GIVEREF(__pyx_v_self->ct);
4167 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
4168 __Pyx_INCREF(__pyx_v_self->name);
4169 __Pyx_GIVEREF(__pyx_v_self->name);
4170 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
4171 __Pyx_GIVEREF(__pyx_t_2);
4172 PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
4175 __pyx_v_state = ((PyObject*)__pyx_t_3);
4185 __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
4186 __Pyx_GOTREF(__pyx_t_3);
4187 __pyx_v__dict = __pyx_t_3;
4197 __pyx_t_4 = (__pyx_v__dict != Py_None);
4198 __pyx_t_5 = (__pyx_t_4 != 0);
4208 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
4209 __Pyx_GOTREF(__pyx_t_3);
4210 __Pyx_INCREF(__pyx_v__dict);
4211 __Pyx_GIVEREF(__pyx_v__dict);
4212 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
4213 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
4214 __Pyx_GOTREF(__pyx_t_2);
4215 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4216 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
4226 __pyx_v_use_setstate = 1;
4246 __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
4247 __pyx_t_6 = (__pyx_t_4 != 0);
4250 __pyx_t_5 = __pyx_t_6;
4251 goto __pyx_L4_bool_binop_done;
4253 __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
4254 __pyx_t_4 = (__pyx_t_6 != 0);
4257 __pyx_t_5 = __pyx_t_4;
4258 goto __pyx_L4_bool_binop_done;
4260 __pyx_t_4 = (__pyx_v_self->ct != Py_None);
4261 __pyx_t_6 = (__pyx_t_4 != 0);
4264 __pyx_t_5 = __pyx_t_6;
4265 goto __pyx_L4_bool_binop_done;
4267 __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
4268 __pyx_t_4 = (__pyx_t_6 != 0);
4269 __pyx_t_5 = __pyx_t_4;
4270 __pyx_L4_bool_binop_done:;
4271 __pyx_v_use_setstate = __pyx_t_5;
4282 __pyx_t_5 = (__pyx_v_use_setstate != 0);
4292 __Pyx_XDECREF(__pyx_r);
4293 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
4294 __Pyx_GOTREF(__pyx_t_2);
4295 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
4296 __Pyx_GOTREF(__pyx_t_3);
4297 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4298 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4299 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4300 __Pyx_INCREF(__pyx_int_158231071);
4301 __Pyx_GIVEREF(__pyx_int_158231071);
4302 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4303 __Pyx_INCREF(Py_None);
4304 __Pyx_GIVEREF(Py_None);
4305 PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
4306 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4307 __Pyx_GOTREF(__pyx_t_1);
4308 __Pyx_GIVEREF(__pyx_t_2);
4309 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4310 __Pyx_GIVEREF(__pyx_t_3);
4311 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
4312 __Pyx_INCREF(__pyx_v_state);
4313 __Pyx_GIVEREF(__pyx_v_state);
4314 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
4317 __pyx_r = __pyx_t_1;
4338 __Pyx_XDECREF(__pyx_r);
4339 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4340 __Pyx_GOTREF(__pyx_t_1);
4341 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
4342 __Pyx_GOTREF(__pyx_t_3);
4343 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4344 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4345 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4346 __Pyx_INCREF(__pyx_int_158231071);
4347 __Pyx_GIVEREF(__pyx_int_158231071);
4348 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4349 __Pyx_INCREF(__pyx_v_state);
4350 __Pyx_GIVEREF(__pyx_v_state);
4351 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
4352 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
4353 __Pyx_GOTREF(__pyx_t_2);
4354 __Pyx_GIVEREF(__pyx_t_1);
4355 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4356 __Pyx_GIVEREF(__pyx_t_3);
4357 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4360 __pyx_r = __pyx_t_2;
4373 __Pyx_XDECREF(__pyx_t_1);
4374 __Pyx_XDECREF(__pyx_t_2);
4375 __Pyx_XDECREF(__pyx_t_3);
4376 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4379 __Pyx_XDECREF(__pyx_v_state);
4380 __Pyx_XDECREF(__pyx_v__dict);
4381 __Pyx_XGIVEREF(__pyx_r);
4382 __Pyx_TraceReturn(__pyx_r, 0);
4383 __Pyx_RefNannyFinishContext();
4395 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
4396 static char __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__[] =
"BC_Base.__setstate_cython__(self, __pyx_state)";
4397 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__};
4398 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4399 PyObject *__pyx_r = 0;
4400 __Pyx_RefNannyDeclarations
4401 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
4402 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4405 __Pyx_RefNannyFinishContext();
4409 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4410 PyObject *__pyx_r = NULL;
4411 __Pyx_TraceDeclarations
4412 __Pyx_RefNannyDeclarations
4413 PyObject *__pyx_t_1 = NULL;
4414 __Pyx_TraceFrameInit(__pyx_codeobj__3)
4415 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
4416 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
4423 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4424 __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4425 __Pyx_GOTREF(__pyx_t_1);
4426 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4436 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4439 __Pyx_XDECREF(__pyx_t_1);
4440 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4443 __Pyx_XGIVEREF(__pyx_r);
4444 __Pyx_TraceReturn(__pyx_r, 0);
4445 __Pyx_RefNannyFinishContext();
4458 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4459 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4461 __Pyx_RefNannyDeclarations
4462 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
4463 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4464 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
4465 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__init__", 0)))
return -1;
4466 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4469 __Pyx_RefNannyFinishContext();
4473 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4475 __Pyx_TraceDeclarations
4476 __Pyx_RefNannyDeclarations
4477 __Pyx_RefNannySetupContext(
"__init__", 0);
4478 __Pyx_TraceCall(
"__init__", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error));
4487 __Pyx_INCREF(Py_None);
4488 __Pyx_GIVEREF(Py_None);
4489 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4490 __Pyx_DECREF(__pyx_v_self->uOfXT);
4491 __pyx_v_self->uOfXT = Py_None;
4505 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4508 __Pyx_TraceReturn(Py_None, 0);
4509 __Pyx_RefNannyFinishContext();
4522 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4523 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython[] =
"BoundaryCondition.init_cython(self)";
4524 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython};
4525 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4526 PyObject *__pyx_r = 0;
4527 __Pyx_RefNannyDeclarations
4528 __Pyx_RefNannySetupContext(
"init_cython (wrapper)", 0);
4529 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4532 __Pyx_RefNannyFinishContext();
4536 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4537 PyObject *__pyx_r = NULL;
4538 __Pyx_TraceDeclarations
4539 __Pyx_RefNannyDeclarations
4540 __Pyx_TraceFrameInit(__pyx_codeobj__4)
4541 __Pyx_RefNannySetupContext(
"init_cython", 0);
4542 __Pyx_TraceCall(
"init_cython", __pyx_f[0], 81, 0, __PYX_ERR(0, 81, __pyx_L1_error));
4551 __Pyx_XDECREF(__pyx_r);
4552 __Pyx_INCREF(__pyx_v_self->uOfXT);
4553 __pyx_r = __pyx_v_self->uOfXT;
4566 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.init_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4569 __Pyx_XGIVEREF(__pyx_r);
4570 __Pyx_TraceReturn(__pyx_r, 0);
4571 __Pyx_RefNannyFinishContext();
4583 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4584 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch) {
4585 __Pyx_TraceDeclarations
4586 __Pyx_RefNannyDeclarations
4587 PyObject *__pyx_t_1 = NULL;
4588 PyObject *__pyx_t_2 = NULL;
4589 PyObject *__pyx_t_3 = NULL;
4590 PyObject *__pyx_t_4 = NULL;
4591 __Pyx_TraceFrameInit(__pyx_codeobj__5)
4592 __Pyx_RefNannySetupContext(
"resetBC", 0);
4593 __Pyx_TraceCall(
"resetBC", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4595 if (unlikely(__pyx_skip_dispatch)) ;
4597 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4598 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
4599 static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
4600 if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
4602 PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
4604 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4605 __Pyx_GOTREF(__pyx_t_1);
4606 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4607 __Pyx_INCREF(__pyx_t_1);
4608 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4609 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4610 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4611 if (likely(__pyx_t_4)) {
4612 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4613 __Pyx_INCREF(__pyx_t_4);
4614 __Pyx_INCREF(
function);
4615 __Pyx_DECREF_SET(__pyx_t_3,
function);
4618 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4619 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4620 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
4621 __Pyx_GOTREF(__pyx_t_2);
4622 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4623 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4624 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4627 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
4628 tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
4629 obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
4630 if (unlikely(type_dict_guard != tp_dict_version)) {
4631 tp_dict_version = obj_dict_version = 0;
4634 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4635 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
4647 __Pyx_INCREF(Py_None);
4648 __Pyx_GIVEREF(Py_None);
4649 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4650 __Pyx_DECREF(__pyx_v_self->uOfXT);
4651 __pyx_v_self->uOfXT = Py_None;
4664 __Pyx_XDECREF(__pyx_t_1);
4665 __Pyx_XDECREF(__pyx_t_2);
4666 __Pyx_XDECREF(__pyx_t_3);
4667 __Pyx_XDECREF(__pyx_t_4);
4668 __Pyx_WriteUnraisable(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4670 __Pyx_TraceReturn(Py_None, 0);
4671 __Pyx_RefNannyFinishContext();
4675 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4676 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC[] =
"BoundaryCondition.resetBC(self) -> void";
4677 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {
"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC};
4678 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4679 PyObject *__pyx_r = 0;
4680 __Pyx_RefNannyDeclarations
4681 __Pyx_RefNannySetupContext(
"resetBC (wrapper)", 0);
4682 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4685 __Pyx_RefNannyFinishContext();
4689 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4690 PyObject *__pyx_r = NULL;
4691 __Pyx_TraceDeclarations
4692 __Pyx_RefNannyDeclarations
4693 PyObject *__pyx_t_1 = NULL;
4694 __Pyx_TraceFrameInit(__pyx_codeobj__5)
4695 __Pyx_RefNannySetupContext(
"resetBC", 0);
4696 __Pyx_TraceCall(
"resetBC (wrapper)", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4697 __Pyx_XDECREF(__pyx_r);
4698 __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4699 __Pyx_GOTREF(__pyx_t_1);
4700 __pyx_r = __pyx_t_1;
4706 __Pyx_XDECREF(__pyx_t_1);
4707 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4710 __Pyx_XGIVEREF(__pyx_r);
4711 __Pyx_TraceReturn(__pyx_r, 0);
4712 __Pyx_RefNannyFinishContext();
4725 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4726 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] =
"BoundaryCondition.setConstantBC(self, value)\n\n function returning constant BC\n\n Parameters\n ----------\n value : float\n Constant value\n\n ";
4727 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4728 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4729 PyObject *__pyx_r = 0;
4730 __Pyx_RefNannyDeclarations
4731 __Pyx_RefNannySetupContext(
"setConstantBC (wrapper)", 0);
4732 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4735 __Pyx_RefNannyFinishContext();
4747 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
4748 PyObject *__pyx_r = NULL;
4749 __Pyx_TraceDeclarations
4750 __Pyx_RefNannyDeclarations
4751 PyObject *__pyx_t_1 = NULL;
4752 PyObject *__pyx_t_2 = NULL;
4753 __Pyx_RefNannySetupContext(
"__defaults__", 0);
4754 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4755 __Pyx_XDECREF(__pyx_r);
4756 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
4757 __Pyx_GOTREF(__pyx_t_1);
4758 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4759 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4760 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4761 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
4762 __Pyx_GOTREF(__pyx_t_2);
4763 __Pyx_GIVEREF(__pyx_t_1);
4764 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4765 __Pyx_INCREF(Py_None);
4766 __Pyx_GIVEREF(Py_None);
4767 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
4769 __pyx_r = __pyx_t_2;
4775 __Pyx_XDECREF(__pyx_t_1);
4776 __Pyx_XDECREF(__pyx_t_2);
4777 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4780 __Pyx_XGIVEREF(__pyx_r);
4781 __Pyx_TraceReturn(__pyx_r, 0);
4782 __Pyx_RefNannyFinishContext();
4787 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4788 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {
"lambda", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
4789 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4790 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4791 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4792 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
4793 PyObject *__pyx_r = 0;
4794 __Pyx_RefNannyDeclarations
4795 __Pyx_RefNannySetupContext(
"lambda (wrapper)", 0);
4797 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
4798 PyObject* values[3] = {0,0,0};
4799 __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
4800 values[2] = __pyx_dynamic_args->__pyx_arg_n;
4801 if (unlikely(__pyx_kwds)) {
4803 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4805 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4807 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4809 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4812 default:
goto __pyx_L5_argtuple_error;
4814 kw_args = PyDict_Size(__pyx_kwds);
4817 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4818 else goto __pyx_L5_argtuple_error;
4821 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4823 __Pyx_RaiseArgtupleInvalid(
"lambda", 0, 2, 3, 1); __PYX_ERR(0, 97, __pyx_L3_error)
4828 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
4829 if (value) { values[2] = value; kw_args--; }
4832 if (unlikely(kw_args > 0)) {
4833 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda") < 0)) __PYX_ERR(0, 97, __pyx_L3_error)
4836 switch (PyTuple_GET_SIZE(__pyx_args)) {
4837 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4839 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4840 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4842 default:
goto __pyx_L5_argtuple_error;
4845 __pyx_v_x = values[0];
4846 __pyx_v_t = values[1];
4847 __pyx_v_n = values[2];
4849 goto __pyx_L4_argument_unpacking_done;
4850 __pyx_L5_argtuple_error:;
4851 __Pyx_RaiseArgtupleInvalid(
"lambda", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error)
4853 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4854 __Pyx_RefNannyFinishContext();
4856 __pyx_L4_argument_unpacking_done:;
4857 __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
4860 __Pyx_RefNannyFinishContext();
4864 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
4865 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4866 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
4867 PyObject *__pyx_r = NULL;
4868 __Pyx_TraceDeclarations
4869 __Pyx_RefNannyDeclarations
4870 __Pyx_RefNannySetupContext(
"lambda", 0);
4871 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4872 __pyx_cur_scope = __pyx_outer_scope;
4873 __Pyx_TraceCall(
"lambda", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4874 __Pyx_XDECREF(__pyx_r);
4875 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(0, 97, __pyx_L1_error) }
4876 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4877 __pyx_r = __pyx_cur_scope->__pyx_v_value;
4882 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4885 __Pyx_XGIVEREF(__pyx_r);
4886 __Pyx_TraceReturn(__pyx_r, 0);
4887 __Pyx_RefNannyFinishContext();
4899 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
4900 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4901 PyObject *__pyx_r = NULL;
4902 __Pyx_TraceDeclarations
4903 __Pyx_RefNannyDeclarations
4904 PyObject *__pyx_t_1 = NULL;
4905 PyObject *__pyx_t_2 = NULL;
4906 PyObject *__pyx_t_3 = NULL;
4907 PyObject *__pyx_t_4 = NULL;
4908 __Pyx_TraceFrameInit(__pyx_codeobj__6)
4909 __Pyx_RefNannySetupContext(
"setConstantBC", 0);
4910 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
4911 if (unlikely(!__pyx_cur_scope)) {
4912 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
4913 __Pyx_INCREF(Py_None);
4914 __PYX_ERR(0, 87, __pyx_L1_error)
4916 __Pyx_GOTREF(__pyx_cur_scope);
4918 __Pyx_TraceCall(
"setConstantBC", __pyx_f[0], 87, 0, __PYX_ERR(0, 87, __pyx_L1_error));
4919 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
4920 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4921 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
4930 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
4931 __Pyx_GOTREF(__pyx_t_1);
4932 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 97, __pyx_L1_error)
4933 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
4934 __Pyx_GOTREF(__pyx_t_3);
4935 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
4936 __Pyx_GOTREF(__pyx_t_4);
4937 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4939 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4940 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
4941 if (likely(__pyx_t_3)) {
4942 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
4943 __Pyx_INCREF(__pyx_t_3);
4944 __Pyx_INCREF(
function);
4945 __Pyx_DECREF_SET(__pyx_t_4,
function);
4948 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
4949 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4950 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
4951 __Pyx_GOTREF(__pyx_t_2);
4952 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4953 __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
4954 __Pyx_GIVEREF(__pyx_t_2);
4956 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_2__defaults__);
4957 __Pyx_GIVEREF(__pyx_t_1);
4958 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4959 __Pyx_DECREF(__pyx_v_self->uOfXT);
4960 __pyx_v_self->uOfXT = __pyx_t_1;
4972 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4975 __Pyx_XDECREF(__pyx_t_1);
4976 __Pyx_XDECREF(__pyx_t_2);
4977 __Pyx_XDECREF(__pyx_t_3);
4978 __Pyx_XDECREF(__pyx_t_4);
4979 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4982 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4983 __Pyx_XGIVEREF(__pyx_r);
4984 __Pyx_TraceReturn(__pyx_r, 0);
4985 __Pyx_RefNannyFinishContext();
4998 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4999 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC[] =
"BoundaryCondition.setLinearBC(self, a0, a)\n\n function returning value=a0+ax*x+ay*y+az*z\n\n Parameters\n ----------\n a0 : float\n constant\n a: numpy.ndarray\n ax,ay,az\n\n ";
5000 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {
"setLinearBC", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC};
5001 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5002 PyObject *__pyx_v_a0 = 0;
5003 PyObject *__pyx_v_a = 0;
5004 PyObject *__pyx_r = 0;
5005 __Pyx_RefNannyDeclarations
5006 __Pyx_RefNannySetupContext(
"setLinearBC (wrapper)", 0);
5008 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a,0};
5009 PyObject* values[2] = {0,0};
5010 if (unlikely(__pyx_kwds)) {
5012 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5014 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5016 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5019 default:
goto __pyx_L5_argtuple_error;
5021 kw_args = PyDict_Size(__pyx_kwds);
5024 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
5025 else goto __pyx_L5_argtuple_error;
5028 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5030 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 2, 2, 1); __PYX_ERR(0, 100, __pyx_L3_error)
5033 if (unlikely(kw_args > 0)) {
5034 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearBC") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
5036 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5037 goto __pyx_L5_argtuple_error;
5039 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5040 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5042 __pyx_v_a0 = values[0];
5043 __pyx_v_a = values[1];
5045 goto __pyx_L4_argument_unpacking_done;
5046 __pyx_L5_argtuple_error:;
5047 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
5049 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5050 __Pyx_RefNannyFinishContext();
5052 __pyx_L4_argument_unpacking_done:;
5053 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a);
5056 __Pyx_RefNannyFinishContext();
5068 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5069 PyObject *__pyx_r = NULL;
5070 __Pyx_TraceDeclarations
5071 __Pyx_RefNannyDeclarations
5072 PyObject *__pyx_t_1 = NULL;
5073 PyObject *__pyx_t_2 = NULL;
5074 __Pyx_RefNannySetupContext(
"__defaults__", 0);
5075 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5076 __Pyx_XDECREF(__pyx_r);
5077 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5078 __Pyx_GOTREF(__pyx_t_1);
5079 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5080 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5081 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5082 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5083 __Pyx_GOTREF(__pyx_t_2);
5084 __Pyx_GIVEREF(__pyx_t_1);
5085 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5086 __Pyx_INCREF(Py_None);
5087 __Pyx_GIVEREF(Py_None);
5088 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5090 __pyx_r = __pyx_t_2;
5096 __Pyx_XDECREF(__pyx_t_1);
5097 __Pyx_XDECREF(__pyx_t_2);
5098 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5101 __Pyx_XGIVEREF(__pyx_r);
5102 __Pyx_TraceReturn(__pyx_r, 0);
5103 __Pyx_RefNannyFinishContext();
5108 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5109 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {
"lambda1", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
5110 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5111 PyObject *__pyx_v_x = 0;
5112 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
5113 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5114 PyObject *__pyx_r = 0;
5115 __Pyx_RefNannyDeclarations
5116 __Pyx_RefNannySetupContext(
"lambda1 (wrapper)", 0);
5118 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5119 PyObject* values[3] = {0,0,0};
5120 __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
5121 values[2] = __pyx_dynamic_args->__pyx_arg_n;
5122 if (unlikely(__pyx_kwds)) {
5124 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5126 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5128 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5130 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5133 default:
goto __pyx_L5_argtuple_error;
5135 kw_args = PyDict_Size(__pyx_kwds);
5138 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5139 else goto __pyx_L5_argtuple_error;
5142 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5144 __Pyx_RaiseArgtupleInvalid(
"lambda1", 0, 2, 3, 1); __PYX_ERR(0, 113, __pyx_L3_error)
5149 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5150 if (value) { values[2] = value; kw_args--; }
5153 if (unlikely(kw_args > 0)) {
5154 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda1") < 0)) __PYX_ERR(0, 113, __pyx_L3_error)
5157 switch (PyTuple_GET_SIZE(__pyx_args)) {
5158 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5160 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5161 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5163 default:
goto __pyx_L5_argtuple_error;
5166 __pyx_v_x = values[0];
5167 __pyx_v_t = values[1];
5168 __pyx_v_n = values[2];
5170 goto __pyx_L4_argument_unpacking_done;
5171 __pyx_L5_argtuple_error:;
5172 __Pyx_RaiseArgtupleInvalid(
"lambda1", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error)
5174 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5175 __Pyx_RefNannyFinishContext();
5177 __pyx_L4_argument_unpacking_done:;
5178 __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5181 __Pyx_RefNannyFinishContext();
5185 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5186 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5187 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
5188 PyObject *__pyx_r = NULL;
5189 __Pyx_TraceDeclarations
5190 __Pyx_RefNannyDeclarations
5191 PyObject *__pyx_t_1 = NULL;
5192 PyObject *__pyx_t_2 = NULL;
5193 PyObject *__pyx_t_3 = NULL;
5194 __Pyx_RefNannySetupContext(
"lambda1", 0);
5195 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
5196 __pyx_cur_scope = __pyx_outer_scope;
5197 __Pyx_TraceCall(
"lambda1", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5198 __Pyx_XDECREF(__pyx_r);
5199 if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError(
"a0"); __PYX_ERR(0, 113, __pyx_L1_error) }
5200 if (unlikely(!__pyx_cur_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError(
"a"); __PYX_ERR(0, 113, __pyx_L1_error) }
5201 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_a, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5202 __Pyx_GOTREF(__pyx_t_1);
5203 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5204 __Pyx_GOTREF(__pyx_t_2);
5205 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5206 __Pyx_GOTREF(__pyx_t_3);
5207 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5208 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5209 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5210 __Pyx_GOTREF(__pyx_t_2);
5211 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5212 __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5213 __Pyx_GOTREF(__pyx_t_3);
5214 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5215 __pyx_r = __pyx_t_3;
5221 __Pyx_XDECREF(__pyx_t_1);
5222 __Pyx_XDECREF(__pyx_t_2);
5223 __Pyx_XDECREF(__pyx_t_3);
5224 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5227 __Pyx_XGIVEREF(__pyx_r);
5228 __Pyx_TraceReturn(__pyx_r, 0);
5229 __Pyx_RefNannyFinishContext();
5241 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a) {
5242 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5243 PyObject *__pyx_r = NULL;
5244 __Pyx_TraceDeclarations
5245 __Pyx_RefNannyDeclarations
5246 PyObject *__pyx_t_1 = NULL;
5247 PyObject *__pyx_t_2 = NULL;
5248 PyObject *__pyx_t_3 = NULL;
5249 PyObject *__pyx_t_4 = NULL;
5250 __Pyx_TraceFrameInit(__pyx_codeobj__8)
5251 __Pyx_RefNannySetupContext(
"setLinearBC", 0);
5252 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
5253 if (unlikely(!__pyx_cur_scope)) {
5254 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
5255 __Pyx_INCREF(Py_None);
5256 __PYX_ERR(0, 100, __pyx_L1_error)
5258 __Pyx_GOTREF(__pyx_cur_scope);
5260 __Pyx_TraceCall(
"setLinearBC", __pyx_f[0], 100, 0, __PYX_ERR(0, 100, __pyx_L1_error));
5261 __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
5262 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
5263 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
5264 __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
5265 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
5266 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
5275 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5276 __Pyx_GOTREF(__pyx_t_1);
5277 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 113, __pyx_L1_error)
5278 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5279 __Pyx_GOTREF(__pyx_t_3);
5280 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
5281 __Pyx_GOTREF(__pyx_t_4);
5282 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5284 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5285 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5286 if (likely(__pyx_t_3)) {
5287 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5288 __Pyx_INCREF(__pyx_t_3);
5289 __Pyx_INCREF(
function);
5290 __Pyx_DECREF_SET(__pyx_t_4,
function);
5293 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5294 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5295 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5296 __Pyx_GOTREF(__pyx_t_2);
5297 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5298 __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5299 __Pyx_GIVEREF(__pyx_t_2);
5301 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_4__defaults__);
5302 __Pyx_GIVEREF(__pyx_t_1);
5303 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5304 __Pyx_DECREF(__pyx_v_self->uOfXT);
5305 __pyx_v_self->uOfXT = __pyx_t_1;
5317 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5320 __Pyx_XDECREF(__pyx_t_1);
5321 __Pyx_XDECREF(__pyx_t_2);
5322 __Pyx_XDECREF(__pyx_t_3);
5323 __Pyx_XDECREF(__pyx_t_4);
5324 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5327 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5328 __Pyx_XGIVEREF(__pyx_r);
5329 __Pyx_TraceReturn(__pyx_r, 0);
5330 __Pyx_RefNannyFinishContext();
5343 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5344 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp[] =
"BoundaryCondition.setLinearRamp(self, t1, value)\n\n function setting a linear ramp from t=0 to t=t1\n\n Parameters\n -----------\n t1: float\n Ramp end time\n value: float\n Variable value\n ";
5345 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp = {
"setLinearRamp", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp};
5346 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5347 PyObject *__pyx_v_t1 = 0;
5348 PyObject *__pyx_v_value = 0;
5349 PyObject *__pyx_r = 0;
5350 __Pyx_RefNannyDeclarations
5351 __Pyx_RefNannySetupContext(
"setLinearRamp (wrapper)", 0);
5353 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1,&__pyx_n_s_value,0};
5354 PyObject* values[2] = {0,0};
5355 if (unlikely(__pyx_kwds)) {
5357 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5359 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5361 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5364 default:
goto __pyx_L5_argtuple_error;
5366 kw_args = PyDict_Size(__pyx_kwds);
5369 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
5370 else goto __pyx_L5_argtuple_error;
5373 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5375 __Pyx_RaiseArgtupleInvalid(
"setLinearRamp", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
5378 if (unlikely(kw_args > 0)) {
5379 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearRamp") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
5381 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5382 goto __pyx_L5_argtuple_error;
5384 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5385 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5387 __pyx_v_t1 = values[0];
5388 __pyx_v_value = values[1];
5390 goto __pyx_L4_argument_unpacking_done;
5391 __pyx_L5_argtuple_error:;
5392 __Pyx_RaiseArgtupleInvalid(
"setLinearRamp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
5394 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5395 __Pyx_RefNannyFinishContext();
5397 __pyx_L4_argument_unpacking_done:;
5398 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_t1, __pyx_v_value);
5401 __Pyx_RefNannyFinishContext();
5411 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5412 PyObject *__pyx_r = NULL;
5413 __Pyx_TraceDeclarations
5414 __Pyx_RefNannyDeclarations
5415 PyObject *__pyx_t_1 = NULL;
5416 PyObject *__pyx_t_2 = NULL;
5417 __Pyx_RefNannySetupContext(
"__defaults__", 0);
5418 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5419 __Pyx_XDECREF(__pyx_r);
5420 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5421 __Pyx_GOTREF(__pyx_t_1);
5422 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5423 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5424 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5425 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5426 __Pyx_GOTREF(__pyx_t_2);
5427 __Pyx_GIVEREF(__pyx_t_1);
5428 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5429 __Pyx_INCREF(Py_None);
5430 __Pyx_GIVEREF(Py_None);
5431 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5433 __pyx_r = __pyx_t_2;
5439 __Pyx_XDECREF(__pyx_t_1);
5440 __Pyx_XDECREF(__pyx_t_2);
5441 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5444 __Pyx_XGIVEREF(__pyx_r);
5445 __Pyx_TraceReturn(__pyx_r, 0);
5446 __Pyx_RefNannyFinishContext();
5451 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5452 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2 = {
"lambda2", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, METH_VARARGS|METH_KEYWORDS, 0};
5453 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5454 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
5455 PyObject *__pyx_v_t = 0;
5456 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5457 PyObject *__pyx_r = 0;
5458 __Pyx_RefNannyDeclarations
5459 __Pyx_RefNannySetupContext(
"lambda2 (wrapper)", 0);
5461 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5462 PyObject* values[3] = {0,0,0};
5463 __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
5464 values[2] = __pyx_dynamic_args->__pyx_arg_n;
5465 if (unlikely(__pyx_kwds)) {
5467 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5469 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5471 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5473 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5476 default:
goto __pyx_L5_argtuple_error;
5478 kw_args = PyDict_Size(__pyx_kwds);
5481 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5482 else goto __pyx_L5_argtuple_error;
5485 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5487 __Pyx_RaiseArgtupleInvalid(
"lambda2", 0, 2, 3, 1); __PYX_ERR(0, 126, __pyx_L3_error)
5492 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5493 if (value) { values[2] = value; kw_args--; }
5496 if (unlikely(kw_args > 0)) {
5497 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda2") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
5500 switch (PyTuple_GET_SIZE(__pyx_args)) {
5501 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5503 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5504 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5506 default:
goto __pyx_L5_argtuple_error;
5509 __pyx_v_x = values[0];
5510 __pyx_v_t = values[1];
5511 __pyx_v_n = values[2];
5513 goto __pyx_L4_argument_unpacking_done;
5514 __pyx_L5_argtuple_error:;
5515 __Pyx_RaiseArgtupleInvalid(
"lambda2", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
5517 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5518 __Pyx_RefNannyFinishContext();
5520 __pyx_L4_argument_unpacking_done:;
5521 __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5524 __Pyx_RefNannyFinishContext();
5528 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5529 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5530 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_outer_scope;
5531 PyObject *__pyx_r = NULL;
5532 __Pyx_TraceDeclarations
5533 __Pyx_RefNannyDeclarations
5535 PyObject *__pyx_t_2 = NULL;
5536 PyObject *__pyx_t_3 = NULL;
5537 PyObject *__pyx_t_4 = NULL;
5538 PyObject *__pyx_t_5 = NULL;
5540 __Pyx_RefNannySetupContext(
"lambda2", 0);
5541 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *) __Pyx_CyFunction_GetClosure(__pyx_self);
5542 __pyx_cur_scope = __pyx_outer_scope;
5543 __Pyx_TraceCall(
"lambda2", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5544 __Pyx_XDECREF(__pyx_r);
5546 if (unlikely(!__pyx_cur_scope->__pyx_v_t1)) { __Pyx_RaiseClosureNameError(
"t1"); __PYX_ERR(0, 126, __pyx_L1_error) }
5547 __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_cur_scope->__pyx_v_t1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5548 __Pyx_GOTREF(__pyx_t_2);
5549 __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5550 __Pyx_GOTREF(__pyx_t_4);
5551 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5552 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5553 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
5554 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5556 __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5557 __Pyx_GOTREF(__pyx_t_5);
5558 __pyx_t_3 = __pyx_t_5;
5561 __Pyx_INCREF(__pyx_t_2);
5562 __pyx_t_3 = __pyx_t_2;
5564 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5565 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(0, 126, __pyx_L1_error) }
5566 __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5567 __Pyx_GOTREF(__pyx_t_2);
5568 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5569 __pyx_r = __pyx_t_2;
5575 __Pyx_XDECREF(__pyx_t_2);
5576 __Pyx_XDECREF(__pyx_t_3);
5577 __Pyx_XDECREF(__pyx_t_4);
5578 __Pyx_XDECREF(__pyx_t_5);
5579 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5582 __Pyx_XGIVEREF(__pyx_r);
5583 __Pyx_TraceReturn(__pyx_r, 0);
5584 __Pyx_RefNannyFinishContext();
5596 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value) {
5597 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5598 PyObject *__pyx_r = NULL;
5599 __Pyx_TraceDeclarations
5600 __Pyx_RefNannyDeclarations
5601 PyObject *__pyx_t_1 = NULL;
5602 PyObject *__pyx_t_2 = NULL;
5603 PyObject *__pyx_t_3 = NULL;
5604 PyObject *__pyx_t_4 = NULL;
5605 __Pyx_TraceFrameInit(__pyx_codeobj__9)
5606 __Pyx_RefNannySetupContext(
"setLinearRamp", 0);
5607 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, __pyx_empty_tuple, NULL);
5608 if (unlikely(!__pyx_cur_scope)) {
5609 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)Py_None);
5610 __Pyx_INCREF(Py_None);
5611 __PYX_ERR(0, 115, __pyx_L1_error)
5613 __Pyx_GOTREF(__pyx_cur_scope);
5615 __Pyx_TraceCall(
"setLinearRamp", __pyx_f[0], 115, 0, __PYX_ERR(0, 115, __pyx_L1_error));
5616 __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
5617 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
5618 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
5619 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5620 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5621 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5628 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, 0, __pyx_n_s_setLinearRamp_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5629 __Pyx_GOTREF(__pyx_t_1);
5630 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 126, __pyx_L1_error)
5631 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
5632 __Pyx_GOTREF(__pyx_t_3);
5633 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5634 __Pyx_GOTREF(__pyx_t_4);
5635 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5637 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5638 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5639 if (likely(__pyx_t_3)) {
5640 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5641 __Pyx_INCREF(__pyx_t_3);
5642 __Pyx_INCREF(
function);
5643 __Pyx_DECREF_SET(__pyx_t_4,
function);
5646 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5647 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5648 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5649 __Pyx_GOTREF(__pyx_t_2);
5650 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5651 __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5652 __Pyx_GIVEREF(__pyx_t_2);
5654 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_6__defaults__);
5655 __Pyx_GIVEREF(__pyx_t_1);
5656 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5657 __Pyx_DECREF(__pyx_v_self->uOfXT);
5658 __pyx_v_self->uOfXT = __pyx_t_1;
5670 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5673 __Pyx_XDECREF(__pyx_t_1);
5674 __Pyx_XDECREF(__pyx_t_2);
5675 __Pyx_XDECREF(__pyx_t_3);
5676 __Pyx_XDECREF(__pyx_t_4);
5677 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5680 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5681 __Pyx_XGIVEREF(__pyx_r);
5682 __Pyx_TraceReturn(__pyx_r, 0);
5683 __Pyx_RefNannyFinishContext();
5696 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self);
5697 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
5698 PyObject *__pyx_r = 0;
5699 __Pyx_RefNannyDeclarations
5700 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
5701 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5704 __Pyx_RefNannyFinishContext();
5708 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5709 PyObject *__pyx_r = NULL;
5710 __Pyx_TraceDeclarations
5711 __Pyx_RefNannyDeclarations
5712 __Pyx_RefNannySetupContext(
"__get__", 0);
5713 __Pyx_TraceCall(
"__get__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5714 __Pyx_XDECREF(__pyx_r);
5715 __Pyx_INCREF(__pyx_v_self->uOfXT);
5716 __pyx_r = __pyx_v_self->uOfXT;
5721 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5724 __Pyx_XGIVEREF(__pyx_r);
5725 __Pyx_TraceReturn(__pyx_r, 0);
5726 __Pyx_RefNannyFinishContext();
5731 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
5732 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5734 __Pyx_RefNannyDeclarations
5735 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
5736 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5739 __Pyx_RefNannyFinishContext();
5743 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5745 __Pyx_TraceDeclarations
5746 __Pyx_RefNannyDeclarations
5747 __Pyx_RefNannySetupContext(
"__set__", 0);
5748 __Pyx_TraceCall(
"__set__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5749 __Pyx_INCREF(__pyx_v_value);
5750 __Pyx_GIVEREF(__pyx_v_value);
5751 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5752 __Pyx_DECREF(__pyx_v_self->uOfXT);
5753 __pyx_v_self->uOfXT = __pyx_v_value;
5759 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5762 __Pyx_TraceReturn(Py_None, 0);
5763 __Pyx_RefNannyFinishContext();
5768 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self);
5769 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
5771 __Pyx_RefNannyDeclarations
5772 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
5773 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5776 __Pyx_RefNannyFinishContext();
5780 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5782 __Pyx_TraceDeclarations
5783 __Pyx_RefNannyDeclarations
5784 __Pyx_RefNannySetupContext(
"__del__", 0);
5785 __Pyx_TraceCall(
"__del__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5786 __Pyx_INCREF(Py_None);
5787 __Pyx_GIVEREF(Py_None);
5788 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5789 __Pyx_DECREF(__pyx_v_self->uOfXT);
5790 __pyx_v_self->uOfXT = Py_None;
5796 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5799 __Pyx_TraceReturn(Py_None, 0);
5800 __Pyx_RefNannyFinishContext();
5811 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5812 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__[] =
"BoundaryCondition.__reduce_cython__(self)";
5813 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__};
5814 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5815 PyObject *__pyx_r = 0;
5816 __Pyx_RefNannyDeclarations
5817 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5818 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5821 __Pyx_RefNannyFinishContext();
5825 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5826 PyObject *__pyx_r = NULL;
5827 __Pyx_TraceDeclarations
5828 __Pyx_RefNannyDeclarations
5829 PyObject *__pyx_t_1 = NULL;
5830 __Pyx_TraceFrameInit(__pyx_codeobj__10)
5831 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5832 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
5840 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5841 __Pyx_GOTREF(__pyx_t_1);
5842 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5843 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5844 __PYX_ERR(1, 2, __pyx_L1_error)
5854 __Pyx_XDECREF(__pyx_t_1);
5855 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5857 __Pyx_XGIVEREF(__pyx_r);
5858 __Pyx_TraceReturn(__pyx_r, 0);
5859 __Pyx_RefNannyFinishContext();
5871 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5872 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__[] =
"BoundaryCondition.__setstate_cython__(self, __pyx_state)";
5873 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__};
5874 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5875 PyObject *__pyx_r = 0;
5876 __Pyx_RefNannyDeclarations
5877 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5878 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5881 __Pyx_RefNannyFinishContext();
5885 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5886 PyObject *__pyx_r = NULL;
5887 __Pyx_TraceDeclarations
5888 __Pyx_RefNannyDeclarations
5889 PyObject *__pyx_t_1 = NULL;
5890 __Pyx_TraceFrameInit(__pyx_codeobj__12)
5891 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5892 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
5899 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5900 __Pyx_GOTREF(__pyx_t_1);
5901 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5902 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5903 __PYX_ERR(1, 4, __pyx_L1_error)
5914 __Pyx_XDECREF(__pyx_t_1);
5915 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5917 __Pyx_XGIVEREF(__pyx_r);
5918 __Pyx_TraceReturn(__pyx_r, 0);
5919 __Pyx_RefNannyFinishContext();
5930 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5931 static char __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base[] =
"__pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state)";
5932 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {
"__pyx_unpickle_BC_Base", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base};
5933 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5934 PyObject *__pyx_v___pyx_type = 0;
5935 long __pyx_v___pyx_checksum;
5936 PyObject *__pyx_v___pyx_state = 0;
5937 PyObject *__pyx_r = 0;
5938 __Pyx_RefNannyDeclarations
5939 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base (wrapper)", 0);
5941 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
5942 PyObject* values[3] = {0,0,0};
5943 if (unlikely(__pyx_kwds)) {
5945 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5947 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5949 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5951 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5954 default:
goto __pyx_L5_argtuple_error;
5956 kw_args = PyDict_Size(__pyx_kwds);
5959 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
5960 else goto __pyx_L5_argtuple_error;
5963 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
5965 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
5969 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
5971 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
5974 if (unlikely(kw_args > 0)) {
5975 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
5977 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5978 goto __pyx_L5_argtuple_error;
5980 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5981 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5982 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5984 __pyx_v___pyx_type = values[0];
5985 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
5986 __pyx_v___pyx_state = values[2];
5988 goto __pyx_L4_argument_unpacking_done;
5989 __pyx_L5_argtuple_error:;
5990 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
5992 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5993 __Pyx_RefNannyFinishContext();
5995 __pyx_L4_argument_unpacking_done:;
5996 __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
5999 __Pyx_RefNannyFinishContext();
6003 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
6004 PyObject *__pyx_v___pyx_PickleError = 0;
6005 PyObject *__pyx_v___pyx_result = 0;
6006 PyObject *__pyx_r = NULL;
6007 __Pyx_TraceDeclarations
6008 __Pyx_RefNannyDeclarations
6010 PyObject *__pyx_t_2 = NULL;
6011 PyObject *__pyx_t_3 = NULL;
6012 PyObject *__pyx_t_4 = NULL;
6013 PyObject *__pyx_t_5 = NULL;
6015 __Pyx_TraceFrameInit(__pyx_codeobj__14)
6016 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base", 0);
6017 __Pyx_TraceCall(
"__pyx_unpickle_BC_Base", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6026 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x96e6a1f) != 0);
6036 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6037 __Pyx_GOTREF(__pyx_t_2);
6038 __Pyx_INCREF(__pyx_n_s_PickleError);
6039 __Pyx_GIVEREF(__pyx_n_s_PickleError);
6040 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
6041 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6042 __Pyx_GOTREF(__pyx_t_3);
6043 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6044 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6045 __Pyx_GOTREF(__pyx_t_2);
6046 __Pyx_INCREF(__pyx_t_2);
6047 __pyx_v___pyx_PickleError = __pyx_t_2;
6048 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6049 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6058 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
6059 __Pyx_GOTREF(__pyx_t_2);
6060 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6061 __Pyx_GOTREF(__pyx_t_4);
6062 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6063 __Pyx_INCREF(__pyx_v___pyx_PickleError);
6064 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
6065 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6066 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
6067 if (likely(__pyx_t_5)) {
6068 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
6069 __Pyx_INCREF(__pyx_t_5);
6070 __Pyx_INCREF(
function);
6071 __Pyx_DECREF_SET(__pyx_t_2,
function);
6074 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
6075 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6076 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6077 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
6078 __Pyx_GOTREF(__pyx_t_3);
6079 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6080 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6081 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6082 __PYX_ERR(1, 6, __pyx_L1_error)
6100 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
6101 __Pyx_GOTREF(__pyx_t_2);
6103 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6104 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6105 if (likely(__pyx_t_4)) {
6106 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
6107 __Pyx_INCREF(__pyx_t_4);
6108 __Pyx_INCREF(
function);
6109 __Pyx_DECREF_SET(__pyx_t_2,
function);
6112 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
6113 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6114 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
6115 __Pyx_GOTREF(__pyx_t_3);
6116 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6117 __pyx_v___pyx_result = __pyx_t_3;
6127 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
6128 __pyx_t_6 = (__pyx_t_1 != 0);
6138 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
6139 __pyx_t_3 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
6140 __Pyx_GOTREF(__pyx_t_3);
6141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6159 __Pyx_XDECREF(__pyx_r);
6160 __Pyx_INCREF(__pyx_v___pyx_result);
6161 __pyx_r = __pyx_v___pyx_result;
6172 __Pyx_XDECREF(__pyx_t_2);
6173 __Pyx_XDECREF(__pyx_t_3);
6174 __Pyx_XDECREF(__pyx_t_4);
6175 __Pyx_XDECREF(__pyx_t_5);
6176 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6179 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6180 __Pyx_XDECREF(__pyx_v___pyx_result);
6181 __Pyx_XGIVEREF(__pyx_r);
6182 __Pyx_TraceReturn(__pyx_r, 0);
6183 __Pyx_RefNannyFinishContext();
6195 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
6196 PyObject *__pyx_r = NULL;
6197 __Pyx_TraceDeclarations
6198 __Pyx_RefNannyDeclarations
6199 PyObject *__pyx_t_1 = NULL;
6200 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6203 Py_ssize_t __pyx_t_5;
6206 PyObject *__pyx_t_8 = NULL;
6207 PyObject *__pyx_t_9 = NULL;
6208 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base__set_state", 0);
6209 __Pyx_TraceCall(
"__pyx_unpickle_BC_Base__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
6218 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6219 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6220 __PYX_ERR(1, 12, __pyx_L1_error)
6222 if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6223 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 0);
6224 __Pyx_INCREF(__pyx_t_1);
6225 __Pyx_GIVEREF(__pyx_t_1);
6226 __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
6227 __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
6228 __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
6230 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6231 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6232 __PYX_ERR(1, 12, __pyx_L1_error)
6234 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 1);
6235 __Pyx_INCREF(__pyx_t_1);
6236 __Pyx_GIVEREF(__pyx_t_1);
6237 __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
6238 __Pyx_DECREF(__pyx_v___pyx_result->Shape);
6239 __pyx_v___pyx_result->Shape = __pyx_t_1;
6241 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6242 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6243 __PYX_ERR(1, 12, __pyx_L1_error)
6245 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2), PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
6246 __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
6247 __pyx_v___pyx_result->_b_or = __pyx_t_2;
6248 __pyx_t_2.memview = NULL;
6249 __pyx_t_2.data = NULL;
6250 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6251 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6252 __PYX_ERR(1, 12, __pyx_L1_error)
6254 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 3);
6255 __Pyx_INCREF(__pyx_t_1);
6256 __Pyx_GIVEREF(__pyx_t_1);
6257 __Pyx_GOTREF(__pyx_v___pyx_result->ct);
6258 __Pyx_DECREF(__pyx_v___pyx_result->ct);
6259 __pyx_v___pyx_result->ct = __pyx_t_1;
6261 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6262 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6263 __PYX_ERR(1, 12, __pyx_L1_error)
6265 if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6266 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 4);
6267 __Pyx_INCREF(__pyx_t_1);
6268 __Pyx_GIVEREF(__pyx_t_1);
6269 __Pyx_GOTREF(__pyx_v___pyx_result->name);
6270 __Pyx_DECREF(__pyx_v___pyx_result->name);
6271 __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
6273 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6274 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6275 __PYX_ERR(1, 12, __pyx_L1_error)
6277 __pyx_t_3 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5));
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6278 __pyx_v___pyx_result->nd = __pyx_t_3;
6286 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6287 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
6288 __PYX_ERR(1, 13, __pyx_L1_error)
6290 __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6291 __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
6294 __pyx_t_4 = __pyx_t_6;
6295 goto __pyx_L4_bool_binop_done;
6297 __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6298 __pyx_t_7 = (__pyx_t_6 != 0);
6299 __pyx_t_4 = __pyx_t_7;
6300 __pyx_L4_bool_binop_done:;
6308 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
6309 __Pyx_GOTREF(__pyx_t_8);
6310 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
6311 __Pyx_GOTREF(__pyx_t_9);
6312 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6313 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6314 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6315 __PYX_ERR(1, 14, __pyx_L1_error)
6318 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
6319 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
6320 if (likely(__pyx_t_8)) {
6321 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
6322 __Pyx_INCREF(__pyx_t_8);
6323 __Pyx_INCREF(
function);
6324 __Pyx_DECREF_SET(__pyx_t_9,
function);
6327 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6));
6328 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6329 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6330 __Pyx_GOTREF(__pyx_t_1);
6331 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6332 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6351 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6354 __Pyx_XDECREF(__pyx_t_1);
6355 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
6356 __Pyx_XDECREF(__pyx_t_8);
6357 __Pyx_XDECREF(__pyx_t_9);
6358 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
6361 __Pyx_XGIVEREF(__pyx_r);
6362 __Pyx_TraceReturn(__pyx_r, 0);
6363 __Pyx_RefNannyFinishContext();
6376 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
6377 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
6379 __Pyx_RefNannyDeclarations
6380 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
6381 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
6384 __Pyx_RefNannyFinishContext();
6388 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
6391 int __pyx_v_endian_detector;
6392 int __pyx_v_little_endian;
6395 PyArray_Descr *__pyx_v_descr = 0;
6398 __Pyx_TraceDeclarations
6399 __Pyx_RefNannyDeclarations
6402 PyObject *__pyx_t_3 = NULL;
6406 PyArray_Descr *__pyx_t_7;
6407 PyObject *__pyx_t_8 = NULL;
6409 if (__pyx_v_info == NULL) {
6410 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
6413 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
6414 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6415 __Pyx_GIVEREF(__pyx_v_info->obj);
6416 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[3], 258, 0, __PYX_ERR(3, 258, __pyx_L1_error));
6425 __pyx_v_endian_detector = 1;
6434 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
6443 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6452 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6455 __pyx_t_1 = __pyx_t_2;
6456 goto __pyx_L4_bool_binop_done;
6466 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
6467 __pyx_t_1 = __pyx_t_2;
6468 __pyx_L4_bool_binop_done:;
6477 if (unlikely(__pyx_t_1)) {
6486 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 272, __pyx_L1_error)
6487 __Pyx_GOTREF(__pyx_t_3);
6488 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6489 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6490 __PYX_ERR(3, 272, __pyx_L1_error)
6508 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
6511 __pyx_t_1 = __pyx_t_2;
6512 goto __pyx_L7_bool_binop_done;
6522 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
6523 __pyx_t_1 = __pyx_t_2;
6524 __pyx_L7_bool_binop_done:;
6533 if (unlikely(__pyx_t_1)) {
6542 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 276, __pyx_L1_error)
6543 __Pyx_GOTREF(__pyx_t_3);
6544 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6545 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6546 __PYX_ERR(3, 276, __pyx_L1_error)
6564 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
6573 __pyx_v_info->ndim = __pyx_v_ndim;
6582 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
6592 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
6601 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
6610 __pyx_t_4 = __pyx_v_ndim;
6611 __pyx_t_5 = __pyx_t_4;
6612 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6613 __pyx_v_i = __pyx_t_6;
6622 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
6631 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
6652 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
6661 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
6672 __pyx_v_info->suboffsets = NULL;
6681 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
6690 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
6708 __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
6709 __pyx_t_3 = ((PyObject *)__pyx_t_7);
6710 __Pyx_INCREF(__pyx_t_3);
6711 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
6721 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6722 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6723 __Pyx_GOTREF(__pyx_v_info->obj);
6724 __Pyx_DECREF(__pyx_v_info->obj);
6725 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6734 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
6744 __pyx_t_4 = __pyx_v_descr->type_num;
6745 __pyx_v_t = __pyx_t_4;
6754 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
6756 goto __pyx_L15_next_or;
6759 __pyx_t_2 = (__pyx_v_little_endian != 0);
6762 __pyx_t_1 = __pyx_t_2;
6763 goto __pyx_L14_bool_binop_done;
6774 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
6777 __pyx_t_1 = __pyx_t_2;
6778 goto __pyx_L14_bool_binop_done;
6780 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
6781 __pyx_t_1 = __pyx_t_2;
6782 __pyx_L14_bool_binop_done:;
6791 if (unlikely(__pyx_t_1)) {
6800 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 306, __pyx_L1_error)
6801 __Pyx_GOTREF(__pyx_t_3);
6802 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6803 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6804 __PYX_ERR(3, 306, __pyx_L1_error)
6822 switch (__pyx_v_t) {
6824 __pyx_v_f = ((
char *)
"b");
6835 __pyx_v_f = ((
char *)
"B");
6846 __pyx_v_f = ((
char *)
"h");
6857 __pyx_v_f = ((
char *)
"H");
6868 __pyx_v_f = ((
char *)
"i");
6879 __pyx_v_f = ((
char *)
"I");
6890 __pyx_v_f = ((
char *)
"l");
6901 __pyx_v_f = ((
char *)
"L");
6912 __pyx_v_f = ((
char *)
"q");
6923 __pyx_v_f = ((
char *)
"Q");
6934 __pyx_v_f = ((
char *)
"f");
6945 __pyx_v_f = ((
char *)
"d");
6947 case NPY_LONGDOUBLE:
6956 __pyx_v_f = ((
char *)
"g");
6967 __pyx_v_f = ((
char *)
"Zf");
6978 __pyx_v_f = ((
char *)
"Zd");
6980 case NPY_CLONGDOUBLE:
6989 __pyx_v_f = ((
char *)
"Zg");
7000 __pyx_v_f = ((
char *)
"O");
7011 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
7012 __Pyx_GOTREF(__pyx_t_3);
7013 __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 325, __pyx_L1_error)
7014 __Pyx_GOTREF(__pyx_t_8);
7015 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7016 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
7017 __Pyx_GOTREF(__pyx_t_3);
7018 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7019 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7020 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7021 __PYX_ERR(3, 325, __pyx_L1_error)
7032 __pyx_v_info->format = __pyx_v_f;
7061 __pyx_v_info->format = ((
char *)PyObject_Malloc(0xFF));
7070 (__pyx_v_info->format[0]) =
'^';
7088 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(3, 332, __pyx_L1_error)
7089 __pyx_v_f = __pyx_t_9;
7098 (__pyx_v_f[0]) =
'\x00';
7113 __Pyx_XDECREF(__pyx_t_3);
7114 __Pyx_XDECREF(__pyx_t_8);
7115 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7117 if (__pyx_v_info->obj != NULL) {
7118 __Pyx_GOTREF(__pyx_v_info->obj);
7119 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7123 if (__pyx_v_info->obj == Py_None) {
7124 __Pyx_GOTREF(__pyx_v_info->obj);
7125 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7128 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
7129 __Pyx_TraceReturn(Py_None, 0);
7130 __Pyx_RefNannyFinishContext();
7143 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
7144 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7145 __Pyx_RefNannyDeclarations
7146 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
7147 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
7150 __Pyx_RefNannyFinishContext();
7153 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7154 __Pyx_TraceDeclarations
7155 __Pyx_RefNannyDeclarations
7157 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
7158 __Pyx_TraceCall(
"__releasebuffer__", __pyx_f[3], 337, 0, __PYX_ERR(3, 337, __pyx_L1_error));
7167 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
7177 PyObject_Free(__pyx_v_info->format);
7195 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
7205 PyObject_Free(__pyx_v_info->strides);
7227 __Pyx_WriteUnraisable(
"numpy.ndarray.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7229 __Pyx_TraceReturn(Py_None, 0);
7230 __Pyx_RefNannyFinishContext();
7241 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7242 PyObject *__pyx_r = NULL;
7243 __Pyx_TraceDeclarations
7244 __Pyx_RefNannyDeclarations
7245 PyObject *__pyx_t_1 = NULL;
7246 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
7247 __Pyx_TraceCall(
"PyArray_MultiIterNew1", __pyx_f[3], 821, 0, __PYX_ERR(3, 821, __pyx_L1_error));
7256 __Pyx_XDECREF(__pyx_r);
7257 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 822, __pyx_L1_error)
7258 __Pyx_GOTREF(__pyx_t_1);
7259 __pyx_r = __pyx_t_1;
7273 __Pyx_XDECREF(__pyx_t_1);
7274 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7277 __Pyx_XGIVEREF(__pyx_r);
7278 __Pyx_TraceReturn(__pyx_r, 0);
7279 __Pyx_RefNannyFinishContext();
7291 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7292 PyObject *__pyx_r = NULL;
7293 __Pyx_TraceDeclarations
7294 __Pyx_RefNannyDeclarations
7295 PyObject *__pyx_t_1 = NULL;
7296 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
7297 __Pyx_TraceCall(
"PyArray_MultiIterNew2", __pyx_f[3], 824, 0, __PYX_ERR(3, 824, __pyx_L1_error));
7306 __Pyx_XDECREF(__pyx_r);
7307 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 825, __pyx_L1_error)
7308 __Pyx_GOTREF(__pyx_t_1);
7309 __pyx_r = __pyx_t_1;
7323 __Pyx_XDECREF(__pyx_t_1);
7324 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7327 __Pyx_XGIVEREF(__pyx_r);
7328 __Pyx_TraceReturn(__pyx_r, 0);
7329 __Pyx_RefNannyFinishContext();
7341 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7342 PyObject *__pyx_r = NULL;
7343 __Pyx_TraceDeclarations
7344 __Pyx_RefNannyDeclarations
7345 PyObject *__pyx_t_1 = NULL;
7346 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
7347 __Pyx_TraceCall(
"PyArray_MultiIterNew3", __pyx_f[3], 827, 0, __PYX_ERR(3, 827, __pyx_L1_error));
7356 __Pyx_XDECREF(__pyx_r);
7357 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 828, __pyx_L1_error)
7358 __Pyx_GOTREF(__pyx_t_1);
7359 __pyx_r = __pyx_t_1;
7373 __Pyx_XDECREF(__pyx_t_1);
7374 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7377 __Pyx_XGIVEREF(__pyx_r);
7378 __Pyx_TraceReturn(__pyx_r, 0);
7379 __Pyx_RefNannyFinishContext();
7391 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7392 PyObject *__pyx_r = NULL;
7393 __Pyx_TraceDeclarations
7394 __Pyx_RefNannyDeclarations
7395 PyObject *__pyx_t_1 = NULL;
7396 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
7397 __Pyx_TraceCall(
"PyArray_MultiIterNew4", __pyx_f[3], 830, 0, __PYX_ERR(3, 830, __pyx_L1_error));
7406 __Pyx_XDECREF(__pyx_r);
7407 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 831, __pyx_L1_error)
7408 __Pyx_GOTREF(__pyx_t_1);
7409 __pyx_r = __pyx_t_1;
7423 __Pyx_XDECREF(__pyx_t_1);
7424 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7427 __Pyx_XGIVEREF(__pyx_r);
7428 __Pyx_TraceReturn(__pyx_r, 0);
7429 __Pyx_RefNannyFinishContext();
7441 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7442 PyObject *__pyx_r = NULL;
7443 __Pyx_TraceDeclarations
7444 __Pyx_RefNannyDeclarations
7445 PyObject *__pyx_t_1 = NULL;
7446 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
7447 __Pyx_TraceCall(
"PyArray_MultiIterNew5", __pyx_f[3], 833, 0, __PYX_ERR(3, 833, __pyx_L1_error));
7456 __Pyx_XDECREF(__pyx_r);
7457 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 834, __pyx_L1_error)
7458 __Pyx_GOTREF(__pyx_t_1);
7459 __pyx_r = __pyx_t_1;
7473 __Pyx_XDECREF(__pyx_t_1);
7474 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7477 __Pyx_XGIVEREF(__pyx_r);
7478 __Pyx_TraceReturn(__pyx_r, 0);
7479 __Pyx_RefNannyFinishContext();
7491 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7492 PyObject *__pyx_r = NULL;
7493 __Pyx_TraceDeclarations
7494 __Pyx_RefNannyDeclarations
7496 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
7497 __Pyx_TraceCall(
"PyDataType_SHAPE", __pyx_f[3], 836, 0, __PYX_ERR(3, 836, __pyx_L1_error));
7506 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7516 __Pyx_XDECREF(__pyx_r);
7517 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7518 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7538 __Pyx_XDECREF(__pyx_r);
7539 __Pyx_INCREF(__pyx_empty_tuple);
7540 __pyx_r = __pyx_empty_tuple;
7554 __Pyx_AddTraceback(
"numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
7557 __Pyx_XGIVEREF(__pyx_r);
7558 __Pyx_TraceReturn(__pyx_r, 0);
7559 __Pyx_RefNannyFinishContext();
7571 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
7572 PyArray_Descr *__pyx_v_child = 0;
7573 int __pyx_v_endian_detector;
7574 int __pyx_v_little_endian;
7575 PyObject *__pyx_v_fields = 0;
7576 PyObject *__pyx_v_childname = NULL;
7577 PyObject *__pyx_v_new_offset = NULL;
7578 PyObject *__pyx_v_t = NULL;
7580 __Pyx_TraceDeclarations
7581 __Pyx_RefNannyDeclarations
7582 PyObject *__pyx_t_1 = NULL;
7583 Py_ssize_t __pyx_t_2;
7584 PyObject *__pyx_t_3 = NULL;
7585 PyObject *__pyx_t_4 = NULL;
7591 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
7592 __Pyx_TraceCall(
"_util_dtypestring", __pyx_f[3], 842, 0, __PYX_ERR(3, 842, __pyx_L1_error));
7601 __pyx_v_endian_detector = 1;
7610 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
7619 if (unlikely(__pyx_v_descr->names == Py_None)) {
7620 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
7621 __PYX_ERR(3, 851, __pyx_L1_error)
7623 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7625 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
7626 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7627 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
7629 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
7630 __Pyx_GOTREF(__pyx_t_3);
7632 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
7642 if (unlikely(__pyx_v_descr->fields == Py_None)) {
7643 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7644 __PYX_ERR(3, 852, __pyx_L1_error)
7646 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
7647 __Pyx_GOTREF(__pyx_t_3);
7648 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 852, __pyx_L1_error)
7649 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
7659 if (likely(__pyx_v_fields != Py_None)) {
7660 PyObject* sequence = __pyx_v_fields;
7661 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7662 if (unlikely(size != 2)) {
7663 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7664 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7665 __PYX_ERR(3, 853, __pyx_L1_error)
7667 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7668 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7669 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7670 __Pyx_INCREF(__pyx_t_3);
7671 __Pyx_INCREF(__pyx_t_4);
7673 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
7674 __Pyx_GOTREF(__pyx_t_3);
7675 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
7676 __Pyx_GOTREF(__pyx_t_4);
7679 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 853, __pyx_L1_error)
7681 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 853, __pyx_L1_error)
7682 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7684 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7694 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
7695 __Pyx_GOTREF(__pyx_t_4);
7696 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
7697 __Pyx_GOTREF(__pyx_t_3);
7698 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7699 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(3, 855, __pyx_L1_error)
7700 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7701 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
7702 if (unlikely(__pyx_t_6)) {
7711 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 856, __pyx_L1_error)
7712 __Pyx_GOTREF(__pyx_t_3);
7713 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7714 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7715 __PYX_ERR(3, 856, __pyx_L1_error)
7733 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
7735 goto __pyx_L8_next_or;
7738 __pyx_t_7 = (__pyx_v_little_endian != 0);
7741 __pyx_t_6 = __pyx_t_7;
7742 goto __pyx_L7_bool_binop_done;
7753 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
7756 __pyx_t_6 = __pyx_t_7;
7757 goto __pyx_L7_bool_binop_done;
7759 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7760 __pyx_t_6 = __pyx_t_7;
7761 __pyx_L7_bool_binop_done:;
7770 if (unlikely(__pyx_t_6)) {
7779 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 860, __pyx_L1_error)
7780 __Pyx_GOTREF(__pyx_t_3);
7781 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7782 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7783 __PYX_ERR(3, 860, __pyx_L1_error)
7802 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 870, __pyx_L1_error)
7803 __Pyx_GOTREF(__pyx_t_3);
7804 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 870, __pyx_L1_error)
7805 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7806 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 870, __pyx_L1_error)
7807 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7808 if (!__pyx_t_6)
break;
7817 (__pyx_v_f[0]) = 0x78;
7826 __pyx_v_f = (__pyx_v_f + 1);
7836 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7847 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7856 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7866 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 878, __pyx_L1_error)
7867 __Pyx_GOTREF(__pyx_t_4);
7868 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7878 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7879 if (unlikely(__pyx_t_6)) {
7888 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 880, __pyx_L1_error)
7889 __Pyx_GOTREF(__pyx_t_4);
7890 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7891 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7892 __PYX_ERR(3, 880, __pyx_L1_error)
7910 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 883, __pyx_L1_error)
7911 __Pyx_GOTREF(__pyx_t_4);
7912 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 883, __pyx_L1_error)
7913 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7914 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 883, __pyx_L1_error)
7915 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7917 (__pyx_v_f[0]) = 98;
7928 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 884, __pyx_L1_error)
7929 __Pyx_GOTREF(__pyx_t_3);
7930 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 884, __pyx_L1_error)
7931 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7932 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 884, __pyx_L1_error)
7933 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7935 (__pyx_v_f[0]) = 66;
7946 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
7947 __Pyx_GOTREF(__pyx_t_4);
7948 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 885, __pyx_L1_error)
7949 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7950 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 885, __pyx_L1_error)
7951 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7953 (__pyx_v_f[0]) = 0x68;
7964 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 886, __pyx_L1_error)
7965 __Pyx_GOTREF(__pyx_t_3);
7966 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 886, __pyx_L1_error)
7967 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7968 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 886, __pyx_L1_error)
7969 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7971 (__pyx_v_f[0]) = 72;
7982 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 887, __pyx_L1_error)
7983 __Pyx_GOTREF(__pyx_t_4);
7984 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 887, __pyx_L1_error)
7985 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7986 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 887, __pyx_L1_error)
7987 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7989 (__pyx_v_f[0]) = 0x69;
8000 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 888, __pyx_L1_error)
8001 __Pyx_GOTREF(__pyx_t_3);
8002 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 888, __pyx_L1_error)
8003 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8004 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 888, __pyx_L1_error)
8005 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8007 (__pyx_v_f[0]) = 73;
8018 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 889, __pyx_L1_error)
8019 __Pyx_GOTREF(__pyx_t_4);
8020 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 889, __pyx_L1_error)
8021 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8022 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 889, __pyx_L1_error)
8023 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8025 (__pyx_v_f[0]) = 0x6C;
8036 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 890, __pyx_L1_error)
8037 __Pyx_GOTREF(__pyx_t_3);
8038 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 890, __pyx_L1_error)
8039 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8040 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 890, __pyx_L1_error)
8041 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8043 (__pyx_v_f[0]) = 76;
8054 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 891, __pyx_L1_error)
8055 __Pyx_GOTREF(__pyx_t_4);
8056 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 891, __pyx_L1_error)
8057 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8058 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 891, __pyx_L1_error)
8059 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8061 (__pyx_v_f[0]) = 0x71;
8072 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 892, __pyx_L1_error)
8073 __Pyx_GOTREF(__pyx_t_3);
8074 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 892, __pyx_L1_error)
8075 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8076 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 892, __pyx_L1_error)
8077 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8079 (__pyx_v_f[0]) = 81;
8090 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 893, __pyx_L1_error)
8091 __Pyx_GOTREF(__pyx_t_4);
8092 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 893, __pyx_L1_error)
8093 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8094 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 893, __pyx_L1_error)
8095 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8097 (__pyx_v_f[0]) = 0x66;
8108 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 894, __pyx_L1_error)
8109 __Pyx_GOTREF(__pyx_t_3);
8110 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 894, __pyx_L1_error)
8111 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8112 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 894, __pyx_L1_error)
8113 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8115 (__pyx_v_f[0]) = 0x64;
8126 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 895, __pyx_L1_error)
8127 __Pyx_GOTREF(__pyx_t_4);
8128 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 895, __pyx_L1_error)
8129 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8130 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 895, __pyx_L1_error)
8131 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8133 (__pyx_v_f[0]) = 0x67;
8144 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 896, __pyx_L1_error)
8145 __Pyx_GOTREF(__pyx_t_3);
8146 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 896, __pyx_L1_error)
8147 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8148 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 896, __pyx_L1_error)
8149 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8151 (__pyx_v_f[0]) = 90;
8152 (__pyx_v_f[1]) = 0x66;
8153 __pyx_v_f = (__pyx_v_f + 1);
8164 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 897, __pyx_L1_error)
8165 __Pyx_GOTREF(__pyx_t_4);
8166 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 897, __pyx_L1_error)
8167 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8168 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 897, __pyx_L1_error)
8169 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8171 (__pyx_v_f[0]) = 90;
8172 (__pyx_v_f[1]) = 0x64;
8173 __pyx_v_f = (__pyx_v_f + 1);
8184 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 898, __pyx_L1_error)
8185 __Pyx_GOTREF(__pyx_t_3);
8186 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 898, __pyx_L1_error)
8187 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8188 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 898, __pyx_L1_error)
8189 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8191 (__pyx_v_f[0]) = 90;
8192 (__pyx_v_f[1]) = 0x67;
8193 __pyx_v_f = (__pyx_v_f + 1);
8204 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 899, __pyx_L1_error)
8205 __Pyx_GOTREF(__pyx_t_4);
8206 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 899, __pyx_L1_error)
8207 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8208 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 899, __pyx_L1_error)
8209 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8210 if (likely(__pyx_t_6)) {
8211 (__pyx_v_f[0]) = 79;
8223 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 901, __pyx_L1_error)
8224 __Pyx_GOTREF(__pyx_t_3);
8225 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 901, __pyx_L1_error)
8226 __Pyx_GOTREF(__pyx_t_4);
8227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8228 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8229 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8230 __PYX_ERR(3, 901, __pyx_L1_error)
8241 __pyx_v_f = (__pyx_v_f + 1);
8261 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(3, 906, __pyx_L1_error)
8262 __pyx_v_f = __pyx_t_9;
8274 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8283 __pyx_r = __pyx_v_f;
8296 __Pyx_XDECREF(__pyx_t_1);
8297 __Pyx_XDECREF(__pyx_t_3);
8298 __Pyx_XDECREF(__pyx_t_4);
8299 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
8302 __Pyx_XDECREF((PyObject *)__pyx_v_child);
8303 __Pyx_XDECREF(__pyx_v_fields);
8304 __Pyx_XDECREF(__pyx_v_childname);
8305 __Pyx_XDECREF(__pyx_v_new_offset);
8306 __Pyx_XDECREF(__pyx_v_t);
8307 __Pyx_TraceReturn(Py_None, 0);
8308 __Pyx_RefNannyFinishContext();
8320 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8321 __Pyx_TraceDeclarations
8322 __Pyx_RefNannyDeclarations
8323 __Pyx_RefNannySetupContext(
"set_array_base", 0);
8324 __Pyx_TraceCall(
"set_array_base", __pyx_f[3], 1022, 0, __PYX_ERR(3, 1022, __pyx_L1_error));
8333 Py_INCREF(__pyx_v_base);
8342 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
8355 __Pyx_WriteUnraisable(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8357 __Pyx_TraceReturn(Py_None, 0);
8358 __Pyx_RefNannyFinishContext();
8369 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8370 PyObject *__pyx_v_base;
8371 PyObject *__pyx_r = NULL;
8372 __Pyx_TraceDeclarations
8373 __Pyx_RefNannyDeclarations
8375 __Pyx_RefNannySetupContext(
"get_array_base", 0);
8376 __Pyx_TraceCall(
"get_array_base", __pyx_f[3], 1026, 0, __PYX_ERR(3, 1026, __pyx_L1_error));
8385 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
8394 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
8404 __Pyx_XDECREF(__pyx_r);
8405 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8424 __Pyx_XDECREF(__pyx_r);
8425 __Pyx_INCREF(((PyObject *)__pyx_v_base));
8426 __pyx_r = ((PyObject *)__pyx_v_base);
8439 __Pyx_AddTraceback(
"numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
8442 __Pyx_XGIVEREF(__pyx_r);
8443 __Pyx_TraceReturn(__pyx_r, 0);
8444 __Pyx_RefNannyFinishContext();
8456 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
8458 __Pyx_TraceDeclarations
8459 __Pyx_RefNannyDeclarations
8460 PyObject *__pyx_t_1 = NULL;
8461 PyObject *__pyx_t_2 = NULL;
8462 PyObject *__pyx_t_3 = NULL;
8464 PyObject *__pyx_t_5 = NULL;
8465 PyObject *__pyx_t_6 = NULL;
8466 PyObject *__pyx_t_7 = NULL;
8467 PyObject *__pyx_t_8 = NULL;
8468 __Pyx_RefNannySetupContext(
"import_array", 0);
8469 __Pyx_TraceCall(
"import_array", __pyx_f[3], 1034, 0, __PYX_ERR(3, 1034, __pyx_L1_error));
8479 __Pyx_PyThreadState_declare
8480 __Pyx_PyThreadState_assign
8481 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8482 __Pyx_XGOTREF(__pyx_t_1);
8483 __Pyx_XGOTREF(__pyx_t_2);
8484 __Pyx_XGOTREF(__pyx_t_3);
8494 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 1036, __pyx_L3_error)
8504 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8505 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8506 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8507 goto __pyx_L8_try_end;
8517 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8519 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8520 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1037, __pyx_L5_except_error)
8521 __Pyx_GOTREF(__pyx_t_5);
8522 __Pyx_GOTREF(__pyx_t_6);
8523 __Pyx_GOTREF(__pyx_t_7);
8532 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1038, __pyx_L5_except_error)
8533 __Pyx_GOTREF(__pyx_t_8);
8534 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8535 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8536 __PYX_ERR(3, 1038, __pyx_L5_except_error)
8538 goto __pyx_L5_except_error;
8539 __pyx_L5_except_error:;
8548 __Pyx_XGIVEREF(__pyx_t_1);
8549 __Pyx_XGIVEREF(__pyx_t_2);
8550 __Pyx_XGIVEREF(__pyx_t_3);
8551 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8552 goto __pyx_L1_error;
8568 __Pyx_XDECREF(__pyx_t_5);
8569 __Pyx_XDECREF(__pyx_t_6);
8570 __Pyx_XDECREF(__pyx_t_7);
8571 __Pyx_XDECREF(__pyx_t_8);
8572 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8575 __Pyx_TraceReturn(Py_None, 0);
8576 __Pyx_RefNannyFinishContext();
8588 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
8590 __Pyx_TraceDeclarations
8591 __Pyx_RefNannyDeclarations
8592 PyObject *__pyx_t_1 = NULL;
8593 PyObject *__pyx_t_2 = NULL;
8594 PyObject *__pyx_t_3 = NULL;
8596 PyObject *__pyx_t_5 = NULL;
8597 PyObject *__pyx_t_6 = NULL;
8598 PyObject *__pyx_t_7 = NULL;
8599 PyObject *__pyx_t_8 = NULL;
8600 __Pyx_RefNannySetupContext(
"import_umath", 0);
8601 __Pyx_TraceCall(
"import_umath", __pyx_f[3], 1040, 0, __PYX_ERR(3, 1040, __pyx_L1_error));
8611 __Pyx_PyThreadState_declare
8612 __Pyx_PyThreadState_assign
8613 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8614 __Pyx_XGOTREF(__pyx_t_1);
8615 __Pyx_XGOTREF(__pyx_t_2);
8616 __Pyx_XGOTREF(__pyx_t_3);
8626 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 1042, __pyx_L3_error)
8636 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8637 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8638 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8639 goto __pyx_L8_try_end;
8649 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8651 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8652 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1043, __pyx_L5_except_error)
8653 __Pyx_GOTREF(__pyx_t_5);
8654 __Pyx_GOTREF(__pyx_t_6);
8655 __Pyx_GOTREF(__pyx_t_7);
8664 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1044, __pyx_L5_except_error)
8665 __Pyx_GOTREF(__pyx_t_8);
8666 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8667 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8668 __PYX_ERR(3, 1044, __pyx_L5_except_error)
8670 goto __pyx_L5_except_error;
8671 __pyx_L5_except_error:;
8680 __Pyx_XGIVEREF(__pyx_t_1);
8681 __Pyx_XGIVEREF(__pyx_t_2);
8682 __Pyx_XGIVEREF(__pyx_t_3);
8683 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8684 goto __pyx_L1_error;
8700 __Pyx_XDECREF(__pyx_t_5);
8701 __Pyx_XDECREF(__pyx_t_6);
8702 __Pyx_XDECREF(__pyx_t_7);
8703 __Pyx_XDECREF(__pyx_t_8);
8704 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8707 __Pyx_TraceReturn(Py_None, 0);
8708 __Pyx_RefNannyFinishContext();
8720 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
8722 __Pyx_TraceDeclarations
8723 __Pyx_RefNannyDeclarations
8724 PyObject *__pyx_t_1 = NULL;
8725 PyObject *__pyx_t_2 = NULL;
8726 PyObject *__pyx_t_3 = NULL;
8728 PyObject *__pyx_t_5 = NULL;
8729 PyObject *__pyx_t_6 = NULL;
8730 PyObject *__pyx_t_7 = NULL;
8731 PyObject *__pyx_t_8 = NULL;
8732 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
8733 __Pyx_TraceCall(
"import_ufunc", __pyx_f[3], 1046, 0, __PYX_ERR(3, 1046, __pyx_L1_error));
8743 __Pyx_PyThreadState_declare
8744 __Pyx_PyThreadState_assign
8745 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8746 __Pyx_XGOTREF(__pyx_t_1);
8747 __Pyx_XGOTREF(__pyx_t_2);
8748 __Pyx_XGOTREF(__pyx_t_3);
8758 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 1048, __pyx_L3_error)
8768 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8769 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8770 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8771 goto __pyx_L8_try_end;
8780 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8782 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8783 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1049, __pyx_L5_except_error)
8784 __Pyx_GOTREF(__pyx_t_5);
8785 __Pyx_GOTREF(__pyx_t_6);
8786 __Pyx_GOTREF(__pyx_t_7);
8793 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1050, __pyx_L5_except_error)
8794 __Pyx_GOTREF(__pyx_t_8);
8795 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8796 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8797 __PYX_ERR(3, 1050, __pyx_L5_except_error)
8799 goto __pyx_L5_except_error;
8800 __pyx_L5_except_error:;
8809 __Pyx_XGIVEREF(__pyx_t_1);
8810 __Pyx_XGIVEREF(__pyx_t_2);
8811 __Pyx_XGIVEREF(__pyx_t_3);
8812 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8813 goto __pyx_L1_error;
8829 __Pyx_XDECREF(__pyx_t_5);
8830 __Pyx_XDECREF(__pyx_t_6);
8831 __Pyx_XDECREF(__pyx_t_7);
8832 __Pyx_XDECREF(__pyx_t_8);
8833 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8836 __Pyx_TraceReturn(Py_None, 0);
8837 __Pyx_RefNannyFinishContext();
8850 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8851 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8852 PyObject *__pyx_v_shape = 0;
8853 Py_ssize_t __pyx_v_itemsize;
8854 PyObject *__pyx_v_format = 0;
8855 PyObject *__pyx_v_mode = 0;
8856 int __pyx_v_allocate_buffer;
8858 __Pyx_RefNannyDeclarations
8859 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8861 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8862 PyObject* values[5] = {0,0,0,0,0};
8863 values[3] = ((PyObject *)__pyx_n_s_c);
8864 if (unlikely(__pyx_kwds)) {
8866 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8868 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8870 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8872 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8874 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8876 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8879 default:
goto __pyx_L5_argtuple_error;
8881 kw_args = PyDict_Size(__pyx_kwds);
8884 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8885 else goto __pyx_L5_argtuple_error;
8888 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8890 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
8894 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8896 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
8901 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8902 if (value) { values[3] = value; kw_args--; }
8907 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8908 if (value) { values[4] = value; kw_args--; }
8911 if (unlikely(kw_args > 0)) {
8912 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
8915 switch (PyTuple_GET_SIZE(__pyx_args)) {
8916 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8918 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8920 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8921 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8922 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8924 default:
goto __pyx_L5_argtuple_error;
8927 __pyx_v_shape = ((PyObject*)values[0]);
8928 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8929 __pyx_v_format = values[2];
8930 __pyx_v_mode = values[3];
8932 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
8942 __pyx_v_allocate_buffer = ((int)1);
8945 goto __pyx_L4_argument_unpacking_done;
8946 __pyx_L5_argtuple_error:;
8947 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
8949 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8950 __Pyx_RefNannyFinishContext();
8952 __pyx_L4_argument_unpacking_done:;
8953 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
8954 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8955 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
8957 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8972 __Pyx_RefNannyFinishContext();
8976 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
8978 Py_ssize_t __pyx_v_i;
8979 Py_ssize_t __pyx_v_dim;
8980 PyObject **__pyx_v_p;
8983 __Pyx_TraceDeclarations
8984 __Pyx_RefNannyDeclarations
8985 Py_ssize_t __pyx_t_1;
8987 PyObject *__pyx_t_3 = NULL;
8989 PyObject *__pyx_t_5 = NULL;
8990 PyObject *__pyx_t_6 = NULL;
8993 Py_ssize_t __pyx_t_9;
8994 PyObject *__pyx_t_10 = NULL;
8995 Py_ssize_t __pyx_t_11;
8996 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8997 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
8998 __Pyx_INCREF(__pyx_v_format);
9007 if (unlikely(__pyx_v_shape == Py_None)) {
9008 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
9009 __PYX_ERR(1, 129, __pyx_L1_error)
9011 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
9012 __pyx_v_self->ndim = ((int)__pyx_t_1);
9021 __pyx_v_self->itemsize = __pyx_v_itemsize;
9030 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
9031 if (unlikely(__pyx_t_2)) {
9040 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
9041 __Pyx_GOTREF(__pyx_t_3);
9042 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9043 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9044 __PYX_ERR(1, 133, __pyx_L1_error)
9062 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
9063 if (unlikely(__pyx_t_2)) {
9072 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
9073 __Pyx_GOTREF(__pyx_t_3);
9074 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9075 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9076 __PYX_ERR(1, 136, __pyx_L1_error)
9094 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
9095 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
9105 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
9106 __Pyx_GOTREF(__pyx_t_5);
9108 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9109 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9110 if (likely(__pyx_t_6)) {
9111 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
9112 __Pyx_INCREF(__pyx_t_6);
9113 __Pyx_INCREF(
function);
9114 __Pyx_DECREF_SET(__pyx_t_5,
function);
9117 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
9118 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9119 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
9120 __Pyx_GOTREF(__pyx_t_3);
9121 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9122 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
9141 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
9142 __pyx_t_3 = __pyx_v_format;
9143 __Pyx_INCREF(__pyx_t_3);
9144 __Pyx_GIVEREF(__pyx_t_3);
9145 __Pyx_GOTREF(__pyx_v_self->_format);
9146 __Pyx_DECREF(__pyx_v_self->_format);
9147 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
9157 if (unlikely(__pyx_v_self->_format == Py_None)) {
9158 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
9159 __PYX_ERR(1, 141, __pyx_L1_error)
9161 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
9162 __pyx_v_self->format = __pyx_t_7;
9171 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
9180 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
9189 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
9190 if (unlikely(__pyx_t_4)) {
9199 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
9200 __Pyx_GOTREF(__pyx_t_3);
9201 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9202 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9203 __PYX_ERR(1, 148, __pyx_L1_error)
9222 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
9224 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
9225 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9226 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
9228 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
9229 __Pyx_GOTREF(__pyx_t_5);
9231 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
9232 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9233 __pyx_v_dim = __pyx_t_9;
9234 __pyx_v_idx = __pyx_t_8;
9235 __pyx_t_8 = (__pyx_t_8 + 1);
9244 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
9245 if (unlikely(__pyx_t_4)) {
9254 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
9255 __Pyx_GOTREF(__pyx_t_5);
9256 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9257 __Pyx_GOTREF(__pyx_t_6);
9258 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9259 __Pyx_GOTREF(__pyx_t_10);
9260 __Pyx_GIVEREF(__pyx_t_5);
9261 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
9262 __Pyx_GIVEREF(__pyx_t_6);
9263 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
9266 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9267 __Pyx_GOTREF(__pyx_t_6);
9268 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9269 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9270 __Pyx_GOTREF(__pyx_t_10);
9271 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9272 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9273 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9274 __PYX_ERR(1, 153, __pyx_L1_error)
9292 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
9302 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9311 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
9321 __pyx_v_order =
'F';
9330 __Pyx_INCREF(__pyx_n_u_fortran);
9331 __Pyx_GIVEREF(__pyx_n_u_fortran);
9332 __Pyx_GOTREF(__pyx_v_self->mode);
9333 __Pyx_DECREF(__pyx_v_self->mode);
9334 __pyx_v_self->mode = __pyx_n_u_fortran;
9353 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
9354 if (likely(__pyx_t_4)) {
9363 __pyx_v_order =
'C';
9372 __Pyx_INCREF(__pyx_n_u_c);
9373 __Pyx_GIVEREF(__pyx_n_u_c);
9374 __Pyx_GOTREF(__pyx_v_self->mode);
9375 __Pyx_DECREF(__pyx_v_self->mode);
9376 __pyx_v_self->mode = __pyx_n_u_c;
9396 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
9397 __Pyx_GOTREF(__pyx_t_3);
9398 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
9399 __Pyx_GOTREF(__pyx_t_10);
9400 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9401 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9402 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9403 __PYX_ERR(1, 164, __pyx_L1_error)
9414 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
9423 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
9432 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
9433 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
9434 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9435 __pyx_v_self->dtype_is_object = __pyx_t_4;
9444 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9454 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
9463 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9464 if (unlikely(__pyx_t_4)) {
9473 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
9474 __Pyx_GOTREF(__pyx_t_10);
9475 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9476 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9477 __PYX_ERR(1, 176, __pyx_L1_error)
9495 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9505 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9514 if (unlikely(__pyx_v_itemsize == 0)) {
9515 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
9516 __PYX_ERR(1, 180, __pyx_L1_error)
9518 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9519 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
9520 __PYX_ERR(1, 180, __pyx_L1_error)
9522 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9523 __pyx_t_9 = __pyx_t_1;
9524 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9525 __pyx_v_i = __pyx_t_11;
9534 (__pyx_v_p[__pyx_v_i]) = Py_None;
9576 __Pyx_XDECREF(__pyx_t_3);
9577 __Pyx_XDECREF(__pyx_t_5);
9578 __Pyx_XDECREF(__pyx_t_6);
9579 __Pyx_XDECREF(__pyx_t_10);
9580 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9583 __Pyx_XDECREF(__pyx_v_format);
9584 __Pyx_TraceReturn(Py_None, 0);
9585 __Pyx_RefNannyFinishContext();
9598 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
9599 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
9601 __Pyx_RefNannyDeclarations
9602 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
9603 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
9606 __Pyx_RefNannyFinishContext();
9610 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
9611 int __pyx_v_bufmode;
9613 __Pyx_TraceDeclarations
9614 __Pyx_RefNannyDeclarations
9617 PyObject *__pyx_t_3 = NULL;
9619 Py_ssize_t __pyx_t_5;
9621 Py_ssize_t *__pyx_t_7;
9622 if (__pyx_v_info == NULL) {
9623 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
9626 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
9627 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9628 __Pyx_GIVEREF(__pyx_v_info->obj);
9629 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
9638 __pyx_v_bufmode = -1;
9647 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
9648 __pyx_t_2 = (__pyx_t_1 != 0);
9658 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9677 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
9678 __pyx_t_1 = (__pyx_t_2 != 0);
9688 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9707 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9708 if (unlikely(__pyx_t_1)) {
9717 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
9718 __Pyx_GOTREF(__pyx_t_3);
9719 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9720 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9721 __PYX_ERR(1, 192, __pyx_L1_error)
9739 __pyx_t_4 = __pyx_v_self->data;
9740 __pyx_v_info->buf = __pyx_t_4;
9749 __pyx_t_5 = __pyx_v_self->len;
9750 __pyx_v_info->len = __pyx_t_5;
9759 __pyx_t_6 = __pyx_v_self->ndim;
9760 __pyx_v_info->ndim = __pyx_t_6;
9769 __pyx_t_7 = __pyx_v_self->_shape;
9770 __pyx_v_info->shape = __pyx_t_7;
9779 __pyx_t_7 = __pyx_v_self->_strides;
9780 __pyx_v_info->strides = __pyx_t_7;
9789 __pyx_v_info->suboffsets = NULL;
9798 __pyx_t_5 = __pyx_v_self->itemsize;
9799 __pyx_v_info->itemsize = __pyx_t_5;
9808 __pyx_v_info->readonly = 0;
9817 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9827 __pyx_t_4 = __pyx_v_self->format;
9828 __pyx_v_info->format = __pyx_t_4;
9848 __pyx_v_info->format = NULL;
9859 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9860 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9861 __Pyx_GOTREF(__pyx_v_info->obj);
9862 __Pyx_DECREF(__pyx_v_info->obj);
9863 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9877 __Pyx_XDECREF(__pyx_t_3);
9878 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9880 if (__pyx_v_info->obj != NULL) {
9881 __Pyx_GOTREF(__pyx_v_info->obj);
9882 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9886 if (__pyx_v_info->obj == Py_None) {
9887 __Pyx_GOTREF(__pyx_v_info->obj);
9888 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9891 __Pyx_TraceReturn(Py_None, 0);
9892 __Pyx_RefNannyFinishContext();
9905 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
9906 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9907 __Pyx_RefNannyDeclarations
9908 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9909 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
9912 __Pyx_RefNannyFinishContext();
9915 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
9916 __Pyx_TraceDeclarations
9917 __Pyx_RefNannyDeclarations
9919 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9920 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
9929 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9939 __pyx_v_self->callback_free_data(__pyx_v_self->data);
9958 __pyx_t_1 = (__pyx_v_self->free_data != 0);
9968 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9978 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9996 free(__pyx_v_self->data);
10015 PyObject_Free(__pyx_v_self->_shape);
10028 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10030 __Pyx_TraceReturn(Py_None, 0);
10031 __Pyx_RefNannyFinishContext();
10043 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
10044 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
10045 PyObject *__pyx_r = 0;
10046 __Pyx_RefNannyDeclarations
10047 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10048 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
10051 __Pyx_RefNannyFinishContext();
10055 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
10056 PyObject *__pyx_r = NULL;
10057 __Pyx_TraceDeclarations
10058 __Pyx_RefNannyDeclarations
10059 PyObject *__pyx_t_1 = NULL;
10060 __Pyx_RefNannySetupContext(
"__get__", 0);
10061 __Pyx_TraceCall(
"__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
10070 __Pyx_XDECREF(__pyx_r);
10071 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
10072 __Pyx_GOTREF(__pyx_t_1);
10073 __pyx_r = __pyx_t_1;
10087 __Pyx_XDECREF(__pyx_t_1);
10088 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10091 __Pyx_XGIVEREF(__pyx_r);
10092 __Pyx_TraceReturn(__pyx_r, 0);
10093 __Pyx_RefNannyFinishContext();
10105 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
10107 PyObject *__pyx_r = NULL;
10108 __Pyx_TraceDeclarations
10109 __Pyx_RefNannyDeclarations
10110 PyObject *__pyx_t_1 = NULL;
10111 PyObject *__pyx_t_2 = NULL;
10112 PyObject *__pyx_t_3 = NULL;
10113 __Pyx_RefNannySetupContext(
"get_memview", 0);
10114 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
10123 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
10132 __Pyx_XDECREF(__pyx_r);
10133 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
10134 __Pyx_GOTREF(__pyx_t_1);
10135 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
10136 __Pyx_GOTREF(__pyx_t_2);
10137 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
10138 __Pyx_GOTREF(__pyx_t_3);
10139 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10140 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10141 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
10142 __Pyx_GIVEREF(__pyx_t_1);
10143 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
10144 __Pyx_GIVEREF(__pyx_t_2);
10145 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
10148 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
10149 __Pyx_GOTREF(__pyx_t_2);
10150 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10151 __pyx_r = __pyx_t_2;
10165 __Pyx_XDECREF(__pyx_t_1);
10166 __Pyx_XDECREF(__pyx_t_2);
10167 __Pyx_XDECREF(__pyx_t_3);
10168 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
10171 __Pyx_XGIVEREF(__pyx_r);
10172 __Pyx_TraceReturn(__pyx_r, 0);
10173 __Pyx_RefNannyFinishContext();
10186 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
10187 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
10188 Py_ssize_t __pyx_r;
10189 __Pyx_RefNannyDeclarations
10190 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
10191 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
10194 __Pyx_RefNannyFinishContext();
10198 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
10199 Py_ssize_t __pyx_r;
10200 __Pyx_TraceDeclarations
10201 __Pyx_RefNannyDeclarations
10202 __Pyx_RefNannySetupContext(
"__len__", 0);
10203 __Pyx_TraceCall(
"__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
10212 __pyx_r = (__pyx_v_self->_shape[0]);
10225 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10228 __Pyx_TraceReturn(Py_None, 0);
10229 __Pyx_RefNannyFinishContext();
10242 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
10243 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
10244 PyObject *__pyx_r = 0;
10245 __Pyx_RefNannyDeclarations
10246 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
10247 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
10250 __Pyx_RefNannyFinishContext();
10254 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
10255 PyObject *__pyx_r = NULL;
10256 __Pyx_TraceDeclarations
10257 __Pyx_RefNannyDeclarations
10258 PyObject *__pyx_t_1 = NULL;
10259 PyObject *__pyx_t_2 = NULL;
10260 __Pyx_RefNannySetupContext(
"__getattr__", 0);
10261 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
10270 __Pyx_XDECREF(__pyx_r);
10271 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
10272 __Pyx_GOTREF(__pyx_t_1);
10273 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
10274 __Pyx_GOTREF(__pyx_t_2);
10275 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10276 __pyx_r = __pyx_t_2;
10290 __Pyx_XDECREF(__pyx_t_1);
10291 __Pyx_XDECREF(__pyx_t_2);
10292 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10295 __Pyx_XGIVEREF(__pyx_r);
10296 __Pyx_TraceReturn(__pyx_r, 0);
10297 __Pyx_RefNannyFinishContext();
10310 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
10311 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
10312 PyObject *__pyx_r = 0;
10313 __Pyx_RefNannyDeclarations
10314 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
10315 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
10318 __Pyx_RefNannyFinishContext();
10322 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
10323 PyObject *__pyx_r = NULL;
10324 __Pyx_TraceDeclarations
10325 __Pyx_RefNannyDeclarations
10326 PyObject *__pyx_t_1 = NULL;
10327 PyObject *__pyx_t_2 = NULL;
10328 __Pyx_RefNannySetupContext(
"__getitem__", 0);
10329 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
10338 __Pyx_XDECREF(__pyx_r);
10339 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
10340 __Pyx_GOTREF(__pyx_t_1);
10341 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
10342 __Pyx_GOTREF(__pyx_t_2);
10343 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10344 __pyx_r = __pyx_t_2;
10358 __Pyx_XDECREF(__pyx_t_1);
10359 __Pyx_XDECREF(__pyx_t_2);
10360 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10363 __Pyx_XGIVEREF(__pyx_r);
10364 __Pyx_TraceReturn(__pyx_r, 0);
10365 __Pyx_RefNannyFinishContext();
10378 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
10379 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10381 __Pyx_RefNannyDeclarations
10382 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
10383 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
10386 __Pyx_RefNannyFinishContext();
10390 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10392 __Pyx_TraceDeclarations
10393 __Pyx_RefNannyDeclarations
10394 PyObject *__pyx_t_1 = NULL;
10395 __Pyx_RefNannySetupContext(
"__setitem__", 0);
10396 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
10405 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
10406 __Pyx_GOTREF(__pyx_t_1);
10407 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
10408 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10422 __Pyx_XDECREF(__pyx_t_1);
10423 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10426 __Pyx_TraceReturn(Py_None, 0);
10427 __Pyx_RefNannyFinishContext();
10438 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10439 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
10440 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10441 PyObject *__pyx_r = 0;
10442 __Pyx_RefNannyDeclarations
10443 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10444 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
10447 __Pyx_RefNannyFinishContext();
10451 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
10452 PyObject *__pyx_r = NULL;
10453 __Pyx_TraceDeclarations
10454 __Pyx_RefNannyDeclarations
10455 PyObject *__pyx_t_1 = NULL;
10456 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10457 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
10465 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10466 __Pyx_GOTREF(__pyx_t_1);
10467 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10468 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10469 __PYX_ERR(1, 2, __pyx_L1_error)
10479 __Pyx_XDECREF(__pyx_t_1);
10480 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10482 __Pyx_XGIVEREF(__pyx_r);
10483 __Pyx_TraceReturn(__pyx_r, 0);
10484 __Pyx_RefNannyFinishContext();
10496 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10497 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
10498 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10499 PyObject *__pyx_r = 0;
10500 __Pyx_RefNannyDeclarations
10501 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10502 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10505 __Pyx_RefNannyFinishContext();
10509 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10510 PyObject *__pyx_r = NULL;
10511 __Pyx_TraceDeclarations
10512 __Pyx_RefNannyDeclarations
10513 PyObject *__pyx_t_1 = NULL;
10514 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10515 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
10522 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10523 __Pyx_GOTREF(__pyx_t_1);
10524 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10525 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10526 __PYX_ERR(1, 4, __pyx_L1_error)
10537 __Pyx_XDECREF(__pyx_t_1);
10538 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10540 __Pyx_XGIVEREF(__pyx_r);
10541 __Pyx_TraceReturn(__pyx_r, 0);
10542 __Pyx_RefNannyFinishContext();
10554 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
10555 struct __pyx_array_obj *__pyx_v_result = 0;
10556 struct __pyx_array_obj *__pyx_r = NULL;
10557 __Pyx_TraceDeclarations
10558 __Pyx_RefNannyDeclarations
10560 PyObject *__pyx_t_2 = NULL;
10561 PyObject *__pyx_t_3 = NULL;
10562 PyObject *__pyx_t_4 = NULL;
10563 PyObject *__pyx_t_5 = NULL;
10564 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
10565 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
10574 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10584 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
10585 __Pyx_GOTREF(__pyx_t_2);
10586 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
10587 __Pyx_GOTREF(__pyx_t_3);
10588 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10589 __Pyx_GOTREF(__pyx_t_4);
10590 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
10591 __Pyx_GOTREF(__pyx_t_5);
10592 __Pyx_INCREF(__pyx_v_shape);
10593 __Pyx_GIVEREF(__pyx_v_shape);
10594 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10595 __Pyx_GIVEREF(__pyx_t_2);
10596 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10597 __Pyx_GIVEREF(__pyx_t_3);
10598 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10599 __Pyx_GIVEREF(__pyx_t_4);
10600 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10604 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10605 __Pyx_GOTREF(__pyx_t_4);
10606 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10607 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
10628 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
10629 __Pyx_GOTREF(__pyx_t_4);
10630 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10631 __Pyx_GOTREF(__pyx_t_5);
10632 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10633 __Pyx_GOTREF(__pyx_t_3);
10634 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
10635 __Pyx_GOTREF(__pyx_t_2);
10636 __Pyx_INCREF(__pyx_v_shape);
10637 __Pyx_GIVEREF(__pyx_v_shape);
10638 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10639 __Pyx_GIVEREF(__pyx_t_4);
10640 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10641 __Pyx_GIVEREF(__pyx_t_5);
10642 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10643 __Pyx_GIVEREF(__pyx_t_3);
10644 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10656 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
10657 __Pyx_GOTREF(__pyx_t_3);
10658 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
10667 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10668 __Pyx_GOTREF(__pyx_t_5);
10669 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10670 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10671 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
10681 __pyx_v_result->data = __pyx_v_buf;
10692 __Pyx_XDECREF(((PyObject *)__pyx_r));
10693 __Pyx_INCREF(((PyObject *)__pyx_v_result));
10694 __pyx_r = __pyx_v_result;
10707 __Pyx_XDECREF(__pyx_t_2);
10708 __Pyx_XDECREF(__pyx_t_3);
10709 __Pyx_XDECREF(__pyx_t_4);
10710 __Pyx_XDECREF(__pyx_t_5);
10711 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10714 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10715 __Pyx_XGIVEREF((PyObject *)__pyx_r);
10716 __Pyx_TraceReturn(__pyx_r, 0);
10717 __Pyx_RefNannyFinishContext();
10730 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10731 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10732 PyObject *__pyx_v_name = 0;
10734 __Pyx_RefNannyDeclarations
10735 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
10737 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10738 PyObject* values[1] = {0};
10739 if (unlikely(__pyx_kwds)) {
10740 Py_ssize_t kw_args;
10741 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10742 switch (pos_args) {
10743 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10744 CYTHON_FALLTHROUGH;
10746 default:
goto __pyx_L5_argtuple_error;
10748 kw_args = PyDict_Size(__pyx_kwds);
10749 switch (pos_args) {
10751 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10752 else goto __pyx_L5_argtuple_error;
10754 if (unlikely(kw_args > 0)) {
10755 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
10757 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10758 goto __pyx_L5_argtuple_error;
10760 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10762 __pyx_v_name = values[0];
10764 goto __pyx_L4_argument_unpacking_done;
10765 __pyx_L5_argtuple_error:;
10766 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
10768 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10769 __Pyx_RefNannyFinishContext();
10771 __pyx_L4_argument_unpacking_done:;
10772 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10775 __Pyx_RefNannyFinishContext();
10779 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10781 __Pyx_TraceDeclarations
10782 __Pyx_RefNannyDeclarations
10783 __Pyx_RefNannySetupContext(
"__init__", 0);
10784 __Pyx_TraceCall(
"__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
10793 __Pyx_INCREF(__pyx_v_name);
10794 __Pyx_GIVEREF(__pyx_v_name);
10795 __Pyx_GOTREF(__pyx_v_self->name);
10796 __Pyx_DECREF(__pyx_v_self->name);
10797 __pyx_v_self->name = __pyx_v_name;
10811 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10814 __Pyx_TraceReturn(Py_None, 0);
10815 __Pyx_RefNannyFinishContext();
10828 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
10829 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10830 PyObject *__pyx_r = 0;
10831 __Pyx_RefNannyDeclarations
10832 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10833 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10836 __Pyx_RefNannyFinishContext();
10840 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10841 PyObject *__pyx_r = NULL;
10842 __Pyx_TraceDeclarations
10843 __Pyx_RefNannyDeclarations
10844 __Pyx_RefNannySetupContext(
"__repr__", 0);
10845 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
10854 __Pyx_XDECREF(__pyx_r);
10855 __Pyx_INCREF(__pyx_v_self->name);
10856 __pyx_r = __pyx_v_self->name;
10869 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10872 __Pyx_XGIVEREF(__pyx_r);
10873 __Pyx_TraceReturn(__pyx_r, 0);
10874 __Pyx_RefNannyFinishContext();
10885 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10886 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
10887 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10888 PyObject *__pyx_r = 0;
10889 __Pyx_RefNannyDeclarations
10890 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10891 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10894 __Pyx_RefNannyFinishContext();
10898 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10899 PyObject *__pyx_v_state = 0;
10900 PyObject *__pyx_v__dict = 0;
10901 int __pyx_v_use_setstate;
10902 PyObject *__pyx_r = NULL;
10903 __Pyx_TraceDeclarations
10904 __Pyx_RefNannyDeclarations
10905 PyObject *__pyx_t_1 = NULL;
10908 PyObject *__pyx_t_4 = NULL;
10909 PyObject *__pyx_t_5 = NULL;
10910 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10911 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
10920 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
10921 __Pyx_GOTREF(__pyx_t_1);
10922 __Pyx_INCREF(__pyx_v_self->name);
10923 __Pyx_GIVEREF(__pyx_v_self->name);
10924 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10925 __pyx_v_state = ((PyObject*)__pyx_t_1);
10935 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10936 __Pyx_GOTREF(__pyx_t_1);
10937 __pyx_v__dict = __pyx_t_1;
10947 __pyx_t_2 = (__pyx_v__dict != Py_None);
10948 __pyx_t_3 = (__pyx_t_2 != 0);
10958 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
10959 __Pyx_GOTREF(__pyx_t_1);
10960 __Pyx_INCREF(__pyx_v__dict);
10961 __Pyx_GIVEREF(__pyx_v__dict);
10962 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10963 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
10964 __Pyx_GOTREF(__pyx_t_4);
10965 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10966 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10976 __pyx_v_use_setstate = 1;
10996 __pyx_t_3 = (__pyx_v_self->name != Py_None);
10997 __pyx_v_use_setstate = __pyx_t_3;
11008 __pyx_t_3 = (__pyx_v_use_setstate != 0);
11018 __Pyx_XDECREF(__pyx_r);
11019 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
11020 __Pyx_GOTREF(__pyx_t_4);
11021 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
11022 __Pyx_GOTREF(__pyx_t_1);
11023 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11024 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11025 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11026 __Pyx_INCREF(__pyx_int_184977713);
11027 __Pyx_GIVEREF(__pyx_int_184977713);
11028 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11029 __Pyx_INCREF(Py_None);
11030 __Pyx_GIVEREF(Py_None);
11031 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
11032 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
11033 __Pyx_GOTREF(__pyx_t_5);
11034 __Pyx_GIVEREF(__pyx_t_4);
11035 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11036 __Pyx_GIVEREF(__pyx_t_1);
11037 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
11038 __Pyx_INCREF(__pyx_v_state);
11039 __Pyx_GIVEREF(__pyx_v_state);
11040 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
11043 __pyx_r = __pyx_t_5;
11064 __Pyx_XDECREF(__pyx_r);
11065 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
11066 __Pyx_GOTREF(__pyx_t_5);
11067 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
11068 __Pyx_GOTREF(__pyx_t_1);
11069 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11070 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11071 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11072 __Pyx_INCREF(__pyx_int_184977713);
11073 __Pyx_GIVEREF(__pyx_int_184977713);
11074 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11075 __Pyx_INCREF(__pyx_v_state);
11076 __Pyx_GIVEREF(__pyx_v_state);
11077 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
11078 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
11079 __Pyx_GOTREF(__pyx_t_4);
11080 __Pyx_GIVEREF(__pyx_t_5);
11081 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
11082 __Pyx_GIVEREF(__pyx_t_1);
11083 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
11086 __pyx_r = __pyx_t_4;
11099 __Pyx_XDECREF(__pyx_t_1);
11100 __Pyx_XDECREF(__pyx_t_4);
11101 __Pyx_XDECREF(__pyx_t_5);
11102 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11105 __Pyx_XDECREF(__pyx_v_state);
11106 __Pyx_XDECREF(__pyx_v__dict);
11107 __Pyx_XGIVEREF(__pyx_r);
11108 __Pyx_TraceReturn(__pyx_r, 0);
11109 __Pyx_RefNannyFinishContext();
11121 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11122 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
11123 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11124 PyObject *__pyx_r = 0;
11125 __Pyx_RefNannyDeclarations
11126 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11127 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11130 __Pyx_RefNannyFinishContext();
11134 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11135 PyObject *__pyx_r = NULL;
11136 __Pyx_TraceDeclarations
11137 __Pyx_RefNannyDeclarations
11138 PyObject *__pyx_t_1 = NULL;
11139 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11140 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
11147 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
11148 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
11149 __Pyx_GOTREF(__pyx_t_1);
11150 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11160 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11163 __Pyx_XDECREF(__pyx_t_1);
11164 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11167 __Pyx_XGIVEREF(__pyx_r);
11168 __Pyx_TraceReturn(__pyx_r, 0);
11169 __Pyx_RefNannyFinishContext();
11181 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
11182 Py_intptr_t __pyx_v_aligned_p;
11183 size_t __pyx_v_offset;
11185 __Pyx_TraceDeclarations
11187 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
11196 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
11205 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
11214 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
11224 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
11242 __pyx_r = ((
void *)__pyx_v_aligned_p);
11255 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
11258 __Pyx_TraceReturn(Py_None, 1);
11271 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11272 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11273 PyObject *__pyx_v_obj = 0;
11275 int __pyx_v_dtype_is_object;
11277 __Pyx_RefNannyDeclarations
11278 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
11280 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
11281 PyObject* values[3] = {0,0,0};
11282 if (unlikely(__pyx_kwds)) {
11283 Py_ssize_t kw_args;
11284 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11285 switch (pos_args) {
11286 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11287 CYTHON_FALLTHROUGH;
11288 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11289 CYTHON_FALLTHROUGH;
11290 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11291 CYTHON_FALLTHROUGH;
11293 default:
goto __pyx_L5_argtuple_error;
11295 kw_args = PyDict_Size(__pyx_kwds);
11296 switch (pos_args) {
11298 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
11299 else goto __pyx_L5_argtuple_error;
11300 CYTHON_FALLTHROUGH;
11302 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
11304 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
11306 CYTHON_FALLTHROUGH;
11309 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
11310 if (value) { values[2] = value; kw_args--; }
11313 if (unlikely(kw_args > 0)) {
11314 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
11317 switch (PyTuple_GET_SIZE(__pyx_args)) {
11318 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11319 CYTHON_FALLTHROUGH;
11320 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11321 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11323 default:
goto __pyx_L5_argtuple_error;
11326 __pyx_v_obj = values[0];
11327 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11329 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11331 __pyx_v_dtype_is_object = ((int)0);
11334 goto __pyx_L4_argument_unpacking_done;
11335 __pyx_L5_argtuple_error:;
11336 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
11338 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11339 __Pyx_RefNannyFinishContext();
11341 __pyx_L4_argument_unpacking_done:;
11342 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
11345 __Pyx_RefNannyFinishContext();
11349 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
11351 __Pyx_TraceDeclarations
11352 __Pyx_RefNannyDeclarations
11357 __Pyx_RefNannySetupContext(
"__cinit__", 0);
11358 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
11367 __Pyx_INCREF(__pyx_v_obj);
11368 __Pyx_GIVEREF(__pyx_v_obj);
11369 __Pyx_GOTREF(__pyx_v_self->obj);
11370 __Pyx_DECREF(__pyx_v_self->obj);
11371 __pyx_v_self->obj = __pyx_v_obj;
11380 __pyx_v_self->flags = __pyx_v_flags;
11389 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
11390 __pyx_t_3 = (__pyx_t_2 != 0);
11393 __pyx_t_1 = __pyx_t_3;
11394 goto __pyx_L4_bool_binop_done;
11396 __pyx_t_3 = (__pyx_v_obj != Py_None);
11397 __pyx_t_2 = (__pyx_t_3 != 0);
11398 __pyx_t_1 = __pyx_t_2;
11399 __pyx_L4_bool_binop_done:;
11409 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
11418 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
11428 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
11437 Py_INCREF(Py_None);
11464 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
11474 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11483 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11501 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11511 __pyx_v_self->lock = PyThread_allocate_lock();
11520 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11521 if (unlikely(__pyx_t_1)) {
11530 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
11557 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11567 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
11570 __pyx_t_1 = __pyx_t_2;
11571 goto __pyx_L11_bool_binop_done;
11573 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
11574 __pyx_t_1 = __pyx_t_2;
11575 __pyx_L11_bool_binop_done:;
11576 __pyx_v_self->dtype_is_object = __pyx_t_1;
11596 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11607 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
11616 __pyx_v_self->typeinfo = NULL;
11630 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11633 __Pyx_TraceReturn(Py_None, 0);
11634 __Pyx_RefNannyFinishContext();
11647 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
11648 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11649 __Pyx_RefNannyDeclarations
11650 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
11651 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11654 __Pyx_RefNannyFinishContext();
11657 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11659 __Pyx_TraceDeclarations
11660 __Pyx_RefNannyDeclarations
11666 PyThread_type_lock __pyx_t_6;
11667 PyThread_type_lock __pyx_t_7;
11668 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
11669 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
11678 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11679 __pyx_t_2 = (__pyx_t_1 != 0);
11689 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11707 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11717 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11718 __pyx_t_4 = __pyx_t_3;
11719 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11720 __pyx_v_i = __pyx_t_5;
11729 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11739 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11748 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11758 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11759 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11768 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11769 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11787 goto __pyx_L6_break;
11807 PyThread_free_lock(__pyx_v_self->lock);
11831 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
11833 __Pyx_TraceReturn(Py_None, 0);
11834 __Pyx_RefNannyFinishContext();
11845 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11846 Py_ssize_t __pyx_v_dim;
11847 char *__pyx_v_itemp;
11848 PyObject *__pyx_v_idx = NULL;
11850 __Pyx_TraceDeclarations
11851 __Pyx_RefNannyDeclarations
11852 Py_ssize_t __pyx_t_1;
11853 PyObject *__pyx_t_2 = NULL;
11854 Py_ssize_t __pyx_t_3;
11855 PyObject *(*__pyx_t_4)(PyObject *);
11856 PyObject *__pyx_t_5 = NULL;
11857 Py_ssize_t __pyx_t_6;
11859 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
11860 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 389, 0, __PYX_ERR(1, 389, __pyx_L1_error));
11869 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
11879 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11880 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11883 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 393, __pyx_L1_error)
11884 __Pyx_GOTREF(__pyx_t_2);
11885 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 393, __pyx_L1_error)
11888 if (likely(!__pyx_t_4)) {
11889 if (likely(PyList_CheckExact(__pyx_t_2))) {
11890 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
11891 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11892 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 393, __pyx_L1_error)
11894 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
11895 __Pyx_GOTREF(__pyx_t_5);
11898 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
11899 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11900 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 393, __pyx_L1_error)
11902 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
11903 __Pyx_GOTREF(__pyx_t_5);
11907 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11908 if (unlikely(!__pyx_t_5)) {
11909 PyObject* exc_type = PyErr_Occurred();
11911 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11912 else __PYX_ERR(1, 393, __pyx_L1_error)
11916 __Pyx_GOTREF(__pyx_t_5);
11918 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11920 __pyx_v_dim = __pyx_t_1;
11921 __pyx_t_1 = (__pyx_t_1 + 1);
11930 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 394, __pyx_L1_error)
11931 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 394, __pyx_L1_error)
11932 __pyx_v_itemp = __pyx_t_7;
11942 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11951 __pyx_r = __pyx_v_itemp;
11964 __Pyx_XDECREF(__pyx_t_2);
11965 __Pyx_XDECREF(__pyx_t_5);
11966 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11969 __Pyx_XDECREF(__pyx_v_idx);
11970 __Pyx_TraceReturn(Py_None, 0);
11971 __Pyx_RefNannyFinishContext();
11984 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
11985 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11986 PyObject *__pyx_r = 0;
11987 __Pyx_RefNannyDeclarations
11988 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
11989 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11992 __Pyx_RefNannyFinishContext();
11996 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11997 PyObject *__pyx_v_have_slices = NULL;
11998 PyObject *__pyx_v_indices = NULL;
11999 char *__pyx_v_itemp;
12000 PyObject *__pyx_r = NULL;
12001 __Pyx_TraceDeclarations
12002 __Pyx_RefNannyDeclarations
12005 PyObject *__pyx_t_3 = NULL;
12006 PyObject *__pyx_t_4 = NULL;
12007 PyObject *__pyx_t_5 = NULL;
12009 __Pyx_RefNannySetupContext(
"__getitem__", 0);
12010 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 399, 0, __PYX_ERR(1, 399, __pyx_L1_error));
12019 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12020 __pyx_t_2 = (__pyx_t_1 != 0);
12030 __Pyx_XDECREF(__pyx_r);
12031 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12032 __pyx_r = ((PyObject *)__pyx_v_self);
12051 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
12052 __Pyx_GOTREF(__pyx_t_3);
12053 if (likely(__pyx_t_3 != Py_None)) {
12054 PyObject* sequence = __pyx_t_3;
12055 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12056 if (unlikely(size != 2)) {
12057 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12058 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12059 __PYX_ERR(1, 403, __pyx_L1_error)
12061 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12062 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
12063 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
12064 __Pyx_INCREF(__pyx_t_4);
12065 __Pyx_INCREF(__pyx_t_5);
12067 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 403, __pyx_L1_error)
12068 __Pyx_GOTREF(__pyx_t_4);
12069 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 403, __pyx_L1_error)
12070 __Pyx_GOTREF(__pyx_t_5);
12072 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12074 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 403, __pyx_L1_error)
12076 __pyx_v_have_slices = __pyx_t_4;
12078 __pyx_v_indices = __pyx_t_5;
12088 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 406, __pyx_L1_error)
12098 __Pyx_XDECREF(__pyx_r);
12099 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
12100 __Pyx_GOTREF(__pyx_t_3);
12101 __pyx_r = __pyx_t_3;
12122 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 409, __pyx_L1_error)
12123 __pyx_v_itemp = __pyx_t_6;
12132 __Pyx_XDECREF(__pyx_r);
12133 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 410, __pyx_L1_error)
12134 __Pyx_GOTREF(__pyx_t_3);
12135 __pyx_r = __pyx_t_3;
12150 __Pyx_XDECREF(__pyx_t_3);
12151 __Pyx_XDECREF(__pyx_t_4);
12152 __Pyx_XDECREF(__pyx_t_5);
12153 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12156 __Pyx_XDECREF(__pyx_v_have_slices);
12157 __Pyx_XDECREF(__pyx_v_indices);
12158 __Pyx_XGIVEREF(__pyx_r);
12159 __Pyx_TraceReturn(__pyx_r, 0);
12160 __Pyx_RefNannyFinishContext();
12173 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
12174 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12176 __Pyx_RefNannyDeclarations
12177 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
12178 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
12181 __Pyx_RefNannyFinishContext();
12185 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12186 PyObject *__pyx_v_have_slices = NULL;
12187 PyObject *__pyx_v_obj = NULL;
12189 __Pyx_TraceDeclarations
12190 __Pyx_RefNannyDeclarations
12192 PyObject *__pyx_t_2 = NULL;
12193 PyObject *__pyx_t_3 = NULL;
12194 PyObject *__pyx_t_4 = NULL;
12195 __Pyx_RefNannySetupContext(
"__setitem__", 0);
12196 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 412, 0, __PYX_ERR(1, 412, __pyx_L1_error));
12197 __Pyx_INCREF(__pyx_v_index);
12206 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
12207 if (unlikely(__pyx_t_1)) {
12216 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 414, __pyx_L1_error)
12217 __Pyx_GOTREF(__pyx_t_2);
12218 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12219 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12220 __PYX_ERR(1, 414, __pyx_L1_error)
12238 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
12239 __Pyx_GOTREF(__pyx_t_2);
12240 if (likely(__pyx_t_2 != Py_None)) {
12241 PyObject* sequence = __pyx_t_2;
12242 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12243 if (unlikely(size != 2)) {
12244 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12245 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12246 __PYX_ERR(1, 416, __pyx_L1_error)
12248 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12249 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12250 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12251 __Pyx_INCREF(__pyx_t_3);
12252 __Pyx_INCREF(__pyx_t_4);
12254 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
12255 __Pyx_GOTREF(__pyx_t_3);
12256 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 416, __pyx_L1_error)
12257 __Pyx_GOTREF(__pyx_t_4);
12259 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12261 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 416, __pyx_L1_error)
12263 __pyx_v_have_slices = __pyx_t_3;
12265 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
12275 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 418, __pyx_L1_error)
12285 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 419, __pyx_L1_error)
12286 __Pyx_GOTREF(__pyx_t_2);
12287 __pyx_v_obj = __pyx_t_2;
12297 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 420, __pyx_L1_error)
12307 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
12308 __Pyx_GOTREF(__pyx_t_2);
12309 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 421, __pyx_L1_error)
12310 __Pyx_GOTREF(__pyx_t_4);
12311 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12312 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12332 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
12333 __Pyx_GOTREF(__pyx_t_4);
12334 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 423, __pyx_L1_error)
12335 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
12336 __Pyx_GOTREF(__pyx_t_2);
12337 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12338 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12360 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
12361 __Pyx_GOTREF(__pyx_t_2);
12362 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12378 __Pyx_XDECREF(__pyx_t_2);
12379 __Pyx_XDECREF(__pyx_t_3);
12380 __Pyx_XDECREF(__pyx_t_4);
12381 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12384 __Pyx_XDECREF(__pyx_v_have_slices);
12385 __Pyx_XDECREF(__pyx_v_obj);
12386 __Pyx_XDECREF(__pyx_v_index);
12387 __Pyx_TraceReturn(Py_None, 0);
12388 __Pyx_RefNannyFinishContext();
12400 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
12401 PyObject *__pyx_r = NULL;
12402 __Pyx_TraceDeclarations
12403 __Pyx_RefNannyDeclarations
12406 PyObject *__pyx_t_3 = NULL;
12407 PyObject *__pyx_t_4 = NULL;
12408 PyObject *__pyx_t_5 = NULL;
12409 PyObject *__pyx_t_6 = NULL;
12410 PyObject *__pyx_t_7 = NULL;
12411 PyObject *__pyx_t_8 = NULL;
12413 __Pyx_RefNannySetupContext(
"is_slice", 0);
12414 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 427, 0, __PYX_ERR(1, 427, __pyx_L1_error));
12415 __Pyx_INCREF(__pyx_v_obj);
12424 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
12425 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12436 __Pyx_PyThreadState_declare
12437 __Pyx_PyThreadState_assign
12438 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
12439 __Pyx_XGOTREF(__pyx_t_3);
12440 __Pyx_XGOTREF(__pyx_t_4);
12441 __Pyx_XGOTREF(__pyx_t_5);
12451 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 430, __pyx_L4_error)
12452 __Pyx_GOTREF(__pyx_t_6);
12461 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 431, __pyx_L4_error)
12462 __Pyx_GOTREF(__pyx_t_7);
12471 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 430, __pyx_L4_error)
12472 __Pyx_GOTREF(__pyx_t_8);
12473 __Pyx_INCREF(__pyx_v_obj);
12474 __Pyx_GIVEREF(__pyx_v_obj);
12475 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12476 __Pyx_GIVEREF(__pyx_t_6);
12477 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12478 __Pyx_GIVEREF(__pyx_t_7);
12479 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12482 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
12483 __Pyx_GOTREF(__pyx_t_7);
12484 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12485 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12496 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12497 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12498 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12499 goto __pyx_L9_try_end;
12501 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12502 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12503 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12512 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12514 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12515 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 432, __pyx_L6_except_error)
12516 __Pyx_GOTREF(__pyx_t_7);
12517 __Pyx_GOTREF(__pyx_t_8);
12518 __Pyx_GOTREF(__pyx_t_6);
12527 __Pyx_XDECREF(__pyx_r);
12528 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12529 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12530 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12531 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12532 goto __pyx_L7_except_return;
12534 goto __pyx_L6_except_error;
12535 __pyx_L6_except_error:;
12544 __Pyx_XGIVEREF(__pyx_t_3);
12545 __Pyx_XGIVEREF(__pyx_t_4);
12546 __Pyx_XGIVEREF(__pyx_t_5);
12547 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12548 goto __pyx_L1_error;
12549 __pyx_L7_except_return:;
12550 __Pyx_XGIVEREF(__pyx_t_3);
12551 __Pyx_XGIVEREF(__pyx_t_4);
12552 __Pyx_XGIVEREF(__pyx_t_5);
12553 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12574 __Pyx_XDECREF(__pyx_r);
12575 __Pyx_INCREF(__pyx_v_obj);
12576 __pyx_r = __pyx_v_obj;
12589 __Pyx_XDECREF(__pyx_t_6);
12590 __Pyx_XDECREF(__pyx_t_7);
12591 __Pyx_XDECREF(__pyx_t_8);
12592 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12595 __Pyx_XDECREF(__pyx_v_obj);
12596 __Pyx_XGIVEREF(__pyx_r);
12597 __Pyx_TraceReturn(__pyx_r, 0);
12598 __Pyx_RefNannyFinishContext();
12610 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12611 __Pyx_memviewslice __pyx_v_dst_slice;
12612 __Pyx_memviewslice __pyx_v_src_slice;
12613 PyObject *__pyx_r = NULL;
12614 __Pyx_TraceDeclarations
12615 __Pyx_RefNannyDeclarations
12616 PyObject *__pyx_t_1 = NULL;
12620 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
12621 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 437, 0, __PYX_ERR(1, 437, __pyx_L1_error));
12630 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
12639 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 442, __pyx_L1_error)
12648 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
12649 __Pyx_GOTREF(__pyx_t_1);
12650 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
12651 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12652 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
12653 __Pyx_GOTREF(__pyx_t_1);
12654 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
12655 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12664 __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 441, __pyx_L1_error)
12675 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12678 __Pyx_XDECREF(__pyx_t_1);
12679 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12682 __Pyx_XGIVEREF(__pyx_r);
12683 __Pyx_TraceReturn(__pyx_r, 0);
12684 __Pyx_RefNannyFinishContext();
12696 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12697 int __pyx_v_array[0x80];
12699 void *__pyx_v_item;
12700 __Pyx_memviewslice *__pyx_v_dst_slice;
12701 __Pyx_memviewslice __pyx_v_tmp_slice;
12702 PyObject *__pyx_r = NULL;
12703 __Pyx_TraceDeclarations
12704 __Pyx_RefNannyDeclarations
12706 PyObject *__pyx_t_2 = NULL;
12709 char const *__pyx_t_5;
12710 PyObject *__pyx_t_6 = NULL;
12711 PyObject *__pyx_t_7 = NULL;
12712 PyObject *__pyx_t_8 = NULL;
12713 PyObject *__pyx_t_9 = NULL;
12714 PyObject *__pyx_t_10 = NULL;
12715 PyObject *__pyx_t_11 = NULL;
12716 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
12717 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 445, 0, __PYX_ERR(1, 445, __pyx_L1_error));
12726 __pyx_v_tmp = NULL;
12735 __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
12744 __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
12754 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12763 __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
12764 if (unlikely(__pyx_t_1)) {
12773 PyErr_NoMemory(); __PYX_ERR(1, 457, __pyx_L1_error)
12791 __pyx_v_item = __pyx_v_tmp;
12811 __pyx_v_item = ((
void *)__pyx_v_array);
12831 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12841 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12861 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 466, __pyx_L6_error)
12862 __Pyx_GOTREF(__pyx_t_2);
12863 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12874 __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12884 __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 471, __pyx_L6_error)
12885 __Pyx_GOTREF(__pyx_t_2);
12886 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12904 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12916 PyMem_Free(__pyx_v_tmp);
12921 __Pyx_PyThreadState_declare
12922 __Pyx_PyThreadState_assign
12923 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12924 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12925 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
12926 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
12927 __Pyx_XGOTREF(__pyx_t_6);
12928 __Pyx_XGOTREF(__pyx_t_7);
12929 __Pyx_XGOTREF(__pyx_t_8);
12930 __Pyx_XGOTREF(__pyx_t_9);
12931 __Pyx_XGOTREF(__pyx_t_10);
12932 __Pyx_XGOTREF(__pyx_t_11);
12933 __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
12935 PyMem_Free(__pyx_v_tmp);
12937 if (PY_MAJOR_VERSION >= 3) {
12938 __Pyx_XGIVEREF(__pyx_t_9);
12939 __Pyx_XGIVEREF(__pyx_t_10);
12940 __Pyx_XGIVEREF(__pyx_t_11);
12941 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
12943 __Pyx_XGIVEREF(__pyx_t_6);
12944 __Pyx_XGIVEREF(__pyx_t_7);
12945 __Pyx_XGIVEREF(__pyx_t_8);
12946 __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
12947 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12948 __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
12949 goto __pyx_L1_error;
12963 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12966 __Pyx_XDECREF(__pyx_t_2);
12967 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12970 __Pyx_XGIVEREF(__pyx_r);
12971 __Pyx_TraceReturn(__pyx_r, 0);
12972 __Pyx_RefNannyFinishContext();
12984 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12985 char *__pyx_v_itemp;
12986 PyObject *__pyx_r = NULL;
12987 __Pyx_TraceDeclarations
12988 __Pyx_RefNannyDeclarations
12990 PyObject *__pyx_t_2 = NULL;
12991 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
12992 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 477, 0, __PYX_ERR(1, 477, __pyx_L1_error));
13001 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 478, __pyx_L1_error)
13002 __pyx_v_itemp = __pyx_t_1;
13011 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 479, __pyx_L1_error)
13012 __Pyx_GOTREF(__pyx_t_2);
13013 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13024 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13027 __Pyx_XDECREF(__pyx_t_2);
13028 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
13031 __Pyx_XGIVEREF(__pyx_r);
13032 __Pyx_TraceReturn(__pyx_r, 0);
13033 __Pyx_RefNannyFinishContext();
13045 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
13046 PyObject *__pyx_v_struct = NULL;
13047 PyObject *__pyx_v_bytesitem = 0;
13048 PyObject *__pyx_v_result = NULL;
13049 PyObject *__pyx_r = NULL;
13050 __Pyx_TraceDeclarations
13051 __Pyx_RefNannyDeclarations
13052 PyObject *__pyx_t_1 = NULL;
13053 PyObject *__pyx_t_2 = NULL;
13054 PyObject *__pyx_t_3 = NULL;
13055 PyObject *__pyx_t_4 = NULL;
13056 PyObject *__pyx_t_5 = NULL;
13057 PyObject *__pyx_t_6 = NULL;
13058 PyObject *__pyx_t_7 = NULL;
13060 PyObject *__pyx_t_9 = NULL;
13063 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
13064 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
13073 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 484, __pyx_L1_error)
13074 __Pyx_GOTREF(__pyx_t_1);
13075 __pyx_v_struct = __pyx_t_1;
13085 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
13086 __Pyx_GOTREF(__pyx_t_1);
13087 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
13098 __Pyx_PyThreadState_declare
13099 __Pyx_PyThreadState_assign
13100 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
13101 __Pyx_XGOTREF(__pyx_t_2);
13102 __Pyx_XGOTREF(__pyx_t_3);
13103 __Pyx_XGOTREF(__pyx_t_4);
13113 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 489, __pyx_L3_error)
13114 __Pyx_GOTREF(__pyx_t_5);
13115 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L3_error)
13116 __Pyx_GOTREF(__pyx_t_6);
13119 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13120 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
13121 if (likely(__pyx_t_7)) {
13122 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
13123 __Pyx_INCREF(__pyx_t_7);
13124 __Pyx_INCREF(
function);
13125 __Pyx_DECREF_SET(__pyx_t_5,
function);
13129 #if CYTHON_FAST_PYCALL
13130 if (PyFunction_Check(__pyx_t_5)) {
13131 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13132 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
13133 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13134 __Pyx_GOTREF(__pyx_t_1);
13135 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13138 #if CYTHON_FAST_PYCCALL
13139 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
13140 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13141 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
13142 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13143 __Pyx_GOTREF(__pyx_t_1);
13144 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13148 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 489, __pyx_L3_error)
13149 __Pyx_GOTREF(__pyx_t_9);
13151 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
13153 __Pyx_GIVEREF(__pyx_t_6);
13154 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
13155 __Pyx_INCREF(__pyx_v_bytesitem);
13156 __Pyx_GIVEREF(__pyx_v_bytesitem);
13157 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
13159 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
13160 __Pyx_GOTREF(__pyx_t_1);
13161 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13163 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13164 __pyx_v_result = __pyx_t_1;
13184 __pyx_t_10 = strlen(__pyx_v_self->view.format);
13185 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
13195 __Pyx_XDECREF(__pyx_r);
13196 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 494, __pyx_L5_except_error)
13197 __Pyx_GOTREF(__pyx_t_1);
13198 __pyx_r = __pyx_t_1;
13200 goto __pyx_L6_except_return;
13218 __Pyx_XDECREF(__pyx_r);
13219 __Pyx_INCREF(__pyx_v_result);
13220 __pyx_r = __pyx_v_result;
13221 goto __pyx_L6_except_return;
13224 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13225 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13226 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13227 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13228 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13237 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
13238 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
13239 __Pyx_GOTREF(__pyx_t_6);
13240 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
13241 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13242 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
13243 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
13245 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13246 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 490, __pyx_L5_except_error)
13247 __Pyx_GOTREF(__pyx_t_9);
13248 __Pyx_GOTREF(__pyx_t_5);
13249 __Pyx_GOTREF(__pyx_t_1);
13258 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 491, __pyx_L5_except_error)
13259 __Pyx_GOTREF(__pyx_t_6);
13260 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
13261 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13262 __PYX_ERR(1, 491, __pyx_L5_except_error)
13264 goto __pyx_L5_except_error;
13265 __pyx_L5_except_error:;
13274 __Pyx_XGIVEREF(__pyx_t_2);
13275 __Pyx_XGIVEREF(__pyx_t_3);
13276 __Pyx_XGIVEREF(__pyx_t_4);
13277 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13278 goto __pyx_L1_error;
13279 __pyx_L6_except_return:;
13280 __Pyx_XGIVEREF(__pyx_t_2);
13281 __Pyx_XGIVEREF(__pyx_t_3);
13282 __Pyx_XGIVEREF(__pyx_t_4);
13283 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13297 __Pyx_XDECREF(__pyx_t_1);
13298 __Pyx_XDECREF(__pyx_t_5);
13299 __Pyx_XDECREF(__pyx_t_6);
13300 __Pyx_XDECREF(__pyx_t_7);
13301 __Pyx_XDECREF(__pyx_t_9);
13302 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13305 __Pyx_XDECREF(__pyx_v_struct);
13306 __Pyx_XDECREF(__pyx_v_bytesitem);
13307 __Pyx_XDECREF(__pyx_v_result);
13308 __Pyx_XGIVEREF(__pyx_r);
13309 __Pyx_TraceReturn(__pyx_r, 0);
13310 __Pyx_RefNannyFinishContext();
13322 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
13323 PyObject *__pyx_v_struct = NULL;
13325 PyObject *__pyx_v_bytesvalue = 0;
13326 Py_ssize_t __pyx_v_i;
13327 PyObject *__pyx_r = NULL;
13328 __Pyx_TraceDeclarations
13329 __Pyx_RefNannyDeclarations
13330 PyObject *__pyx_t_1 = NULL;
13333 PyObject *__pyx_t_4 = NULL;
13334 PyObject *__pyx_t_5 = NULL;
13335 PyObject *__pyx_t_6 = NULL;
13337 PyObject *__pyx_t_8 = NULL;
13338 Py_ssize_t __pyx_t_9;
13339 PyObject *__pyx_t_10 = NULL;
13344 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
13345 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 497, 0, __PYX_ERR(1, 497, __pyx_L1_error));
13354 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
13355 __Pyx_GOTREF(__pyx_t_1);
13356 __pyx_v_struct = __pyx_t_1;
13366 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
13367 __pyx_t_3 = (__pyx_t_2 != 0);
13377 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
13378 __Pyx_GOTREF(__pyx_t_1);
13379 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
13380 __Pyx_GOTREF(__pyx_t_4);
13381 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 506, __pyx_L1_error)
13382 __Pyx_GOTREF(__pyx_t_5);
13383 __Pyx_GIVEREF(__pyx_t_4);
13384 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13386 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
13387 __Pyx_GOTREF(__pyx_t_4);
13388 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 506, __pyx_L1_error)
13389 __Pyx_GOTREF(__pyx_t_6);
13390 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13391 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13392 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
13393 __Pyx_GOTREF(__pyx_t_4);
13394 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13395 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13396 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 506, __pyx_L1_error)
13397 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13418 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 508, __pyx_L1_error)
13419 __Pyx_GOTREF(__pyx_t_6);
13420 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
13421 __Pyx_GOTREF(__pyx_t_1);
13424 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13425 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13426 if (likely(__pyx_t_5)) {
13427 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13428 __Pyx_INCREF(__pyx_t_5);
13429 __Pyx_INCREF(
function);
13430 __Pyx_DECREF_SET(__pyx_t_6,
function);
13434 #if CYTHON_FAST_PYCALL
13435 if (PyFunction_Check(__pyx_t_6)) {
13436 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13437 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
13438 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13439 __Pyx_GOTREF(__pyx_t_4);
13440 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13443 #if CYTHON_FAST_PYCCALL
13444 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13445 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13446 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
13447 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13448 __Pyx_GOTREF(__pyx_t_4);
13449 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13453 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 508, __pyx_L1_error)
13454 __Pyx_GOTREF(__pyx_t_8);
13456 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13458 __Pyx_GIVEREF(__pyx_t_1);
13459 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13460 __Pyx_INCREF(__pyx_v_value);
13461 __Pyx_GIVEREF(__pyx_v_value);
13462 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13464 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
13465 __Pyx_GOTREF(__pyx_t_4);
13466 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13468 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13469 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 508, __pyx_L1_error)
13470 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13483 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13484 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
13485 __PYX_ERR(1, 510, __pyx_L1_error)
13487 __Pyx_INCREF(__pyx_v_bytesvalue);
13488 __pyx_t_10 = __pyx_v_bytesvalue;
13489 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13490 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13491 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13492 __pyx_t_11 = __pyx_t_14;
13493 __pyx_v_c = (__pyx_t_11[0]);
13502 __pyx_v_i = __pyx_t_9;
13511 __pyx_t_9 = (__pyx_t_9 + 1);
13520 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13522 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13533 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13536 __Pyx_XDECREF(__pyx_t_1);
13537 __Pyx_XDECREF(__pyx_t_4);
13538 __Pyx_XDECREF(__pyx_t_5);
13539 __Pyx_XDECREF(__pyx_t_6);
13540 __Pyx_XDECREF(__pyx_t_8);
13541 __Pyx_XDECREF(__pyx_t_10);
13542 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13545 __Pyx_XDECREF(__pyx_v_struct);
13546 __Pyx_XDECREF(__pyx_v_bytesvalue);
13547 __Pyx_XGIVEREF(__pyx_r);
13548 __Pyx_TraceReturn(__pyx_r, 0);
13549 __Pyx_RefNannyFinishContext();
13562 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
13563 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13565 __Pyx_RefNannyDeclarations
13566 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
13567 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
13570 __Pyx_RefNannyFinishContext();
13574 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13576 __Pyx_TraceDeclarations
13577 __Pyx_RefNannyDeclarations
13580 PyObject *__pyx_t_3 = NULL;
13581 Py_ssize_t *__pyx_t_4;
13585 Py_ssize_t __pyx_t_8;
13586 if (__pyx_v_info == NULL) {
13587 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
13590 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
13591 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13592 __Pyx_GIVEREF(__pyx_v_info->obj);
13593 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 514, 0, __PYX_ERR(1, 514, __pyx_L1_error));
13602 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13605 __pyx_t_1 = __pyx_t_2;
13606 goto __pyx_L4_bool_binop_done;
13608 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13609 __pyx_t_1 = __pyx_t_2;
13610 __pyx_L4_bool_binop_done:;
13611 if (unlikely(__pyx_t_1)) {
13620 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
13621 __Pyx_GOTREF(__pyx_t_3);
13622 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13623 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13624 __PYX_ERR(1, 516, __pyx_L1_error)
13642 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13652 __pyx_t_4 = __pyx_v_self->view.shape;
13653 __pyx_v_info->shape = __pyx_t_4;
13673 __pyx_v_info->shape = NULL;
13684 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13694 __pyx_t_4 = __pyx_v_self->view.strides;
13695 __pyx_v_info->strides = __pyx_t_4;
13715 __pyx_v_info->strides = NULL;
13726 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13736 __pyx_t_4 = __pyx_v_self->view.suboffsets;
13737 __pyx_v_info->suboffsets = __pyx_t_4;
13757 __pyx_v_info->suboffsets = NULL;
13768 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13778 __pyx_t_5 = __pyx_v_self->view.format;
13779 __pyx_v_info->format = __pyx_t_5;
13799 __pyx_v_info->format = NULL;
13810 __pyx_t_6 = __pyx_v_self->view.buf;
13811 __pyx_v_info->buf = __pyx_t_6;
13820 __pyx_t_7 = __pyx_v_self->view.ndim;
13821 __pyx_v_info->ndim = __pyx_t_7;
13830 __pyx_t_8 = __pyx_v_self->view.itemsize;
13831 __pyx_v_info->itemsize = __pyx_t_8;
13840 __pyx_t_8 = __pyx_v_self->view.len;
13841 __pyx_v_info->len = __pyx_t_8;
13850 __pyx_t_1 = __pyx_v_self->view.readonly;
13851 __pyx_v_info->readonly = __pyx_t_1;
13860 __Pyx_INCREF(((PyObject *)__pyx_v_self));
13861 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13862 __Pyx_GOTREF(__pyx_v_info->obj);
13863 __Pyx_DECREF(__pyx_v_info->obj);
13864 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13878 __Pyx_XDECREF(__pyx_t_3);
13879 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13881 if (__pyx_v_info->obj != NULL) {
13882 __Pyx_GOTREF(__pyx_v_info->obj);
13883 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13887 if (__pyx_v_info->obj == Py_None) {
13888 __Pyx_GOTREF(__pyx_v_info->obj);
13889 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13892 __Pyx_TraceReturn(Py_None, 0);
13893 __Pyx_RefNannyFinishContext();
13906 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
13907 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13908 PyObject *__pyx_r = 0;
13909 __Pyx_RefNannyDeclarations
13910 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13911 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13914 __Pyx_RefNannyFinishContext();
13918 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13919 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13920 PyObject *__pyx_r = NULL;
13921 __Pyx_TraceDeclarations
13922 __Pyx_RefNannyDeclarations
13923 PyObject *__pyx_t_1 = NULL;
13925 __Pyx_RefNannySetupContext(
"__get__", 0);
13926 __Pyx_TraceCall(
"__get__", __pyx_f[1], 549, 0, __PYX_ERR(1, 549, __pyx_L1_error));
13935 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error)
13936 __Pyx_GOTREF(__pyx_t_1);
13937 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 550, __pyx_L1_error)
13938 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13948 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 551, __pyx_L1_error)
13957 __Pyx_XDECREF(__pyx_r);
13958 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13959 __pyx_r = ((PyObject *)__pyx_v_result);
13972 __Pyx_XDECREF(__pyx_t_1);
13973 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13976 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13977 __Pyx_XGIVEREF(__pyx_r);
13978 __Pyx_TraceReturn(__pyx_r, 0);
13979 __Pyx_RefNannyFinishContext();
13992 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
13993 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13994 PyObject *__pyx_r = 0;
13995 __Pyx_RefNannyDeclarations
13996 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13997 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14000 __Pyx_RefNannyFinishContext();
14004 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14005 PyObject *__pyx_r = NULL;
14006 __Pyx_TraceDeclarations
14007 __Pyx_RefNannyDeclarations
14008 __Pyx_RefNannySetupContext(
"__get__", 0);
14009 __Pyx_TraceCall(
"__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
14018 __Pyx_XDECREF(__pyx_r);
14019 __Pyx_INCREF(__pyx_v_self->obj);
14020 __pyx_r = __pyx_v_self->obj;
14033 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14036 __Pyx_XGIVEREF(__pyx_r);
14037 __Pyx_TraceReturn(__pyx_r, 0);
14038 __Pyx_RefNannyFinishContext();
14051 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
14052 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
14053 PyObject *__pyx_r = 0;
14054 __Pyx_RefNannyDeclarations
14055 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14056 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14059 __Pyx_RefNannyFinishContext();
14063 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14064 Py_ssize_t __pyx_v_length;
14065 PyObject *__pyx_r = NULL;
14066 __Pyx_TraceDeclarations
14067 __Pyx_RefNannyDeclarations
14068 PyObject *__pyx_t_1 = NULL;
14069 Py_ssize_t *__pyx_t_2;
14070 Py_ssize_t *__pyx_t_3;
14071 Py_ssize_t *__pyx_t_4;
14072 PyObject *__pyx_t_5 = NULL;
14073 __Pyx_RefNannySetupContext(
"__get__", 0);
14074 __Pyx_TraceCall(
"__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
14083 __Pyx_XDECREF(__pyx_r);
14084 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 560, __pyx_L1_error)
14085 __Pyx_GOTREF(__pyx_t_1);
14086 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14087 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
14088 __pyx_t_2 = __pyx_t_4;
14089 __pyx_v_length = (__pyx_t_2[0]);
14090 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
14091 __Pyx_GOTREF(__pyx_t_5);
14092 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 560, __pyx_L1_error)
14093 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14095 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
14096 __Pyx_GOTREF(__pyx_t_5);
14097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14098 __pyx_r = __pyx_t_5;
14112 __Pyx_XDECREF(__pyx_t_1);
14113 __Pyx_XDECREF(__pyx_t_5);
14114 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14117 __Pyx_XGIVEREF(__pyx_r);
14118 __Pyx_TraceReturn(__pyx_r, 0);
14119 __Pyx_RefNannyFinishContext();
14132 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
14133 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
14134 PyObject *__pyx_r = 0;
14135 __Pyx_RefNannyDeclarations
14136 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14137 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14140 __Pyx_RefNannyFinishContext();
14144 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14145 Py_ssize_t __pyx_v_stride;
14146 PyObject *__pyx_r = NULL;
14147 __Pyx_TraceDeclarations
14148 __Pyx_RefNannyDeclarations
14150 PyObject *__pyx_t_2 = NULL;
14151 Py_ssize_t *__pyx_t_3;
14152 Py_ssize_t *__pyx_t_4;
14153 Py_ssize_t *__pyx_t_5;
14154 PyObject *__pyx_t_6 = NULL;
14155 __Pyx_RefNannySetupContext(
"__get__", 0);
14156 __Pyx_TraceCall(
"__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
14165 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
14166 if (unlikely(__pyx_t_1)) {
14175 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 566, __pyx_L1_error)
14176 __Pyx_GOTREF(__pyx_t_2);
14177 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14178 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14179 __PYX_ERR(1, 566, __pyx_L1_error)
14197 __Pyx_XDECREF(__pyx_r);
14198 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 568, __pyx_L1_error)
14199 __Pyx_GOTREF(__pyx_t_2);
14200 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
14201 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14202 __pyx_t_3 = __pyx_t_5;
14203 __pyx_v_stride = (__pyx_t_3[0]);
14204 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
14205 __Pyx_GOTREF(__pyx_t_6);
14206 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 568, __pyx_L1_error)
14207 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14209 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
14210 __Pyx_GOTREF(__pyx_t_6);
14211 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14212 __pyx_r = __pyx_t_6;
14226 __Pyx_XDECREF(__pyx_t_2);
14227 __Pyx_XDECREF(__pyx_t_6);
14228 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14231 __Pyx_XGIVEREF(__pyx_r);
14232 __Pyx_TraceReturn(__pyx_r, 0);
14233 __Pyx_RefNannyFinishContext();
14246 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
14247 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
14248 PyObject *__pyx_r = 0;
14249 __Pyx_RefNannyDeclarations
14250 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14251 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14254 __Pyx_RefNannyFinishContext();
14258 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14259 Py_ssize_t __pyx_v_suboffset;
14260 PyObject *__pyx_r = NULL;
14261 __Pyx_TraceDeclarations
14262 __Pyx_RefNannyDeclarations
14264 PyObject *__pyx_t_2 = NULL;
14265 PyObject *__pyx_t_3 = NULL;
14266 Py_ssize_t *__pyx_t_4;
14267 Py_ssize_t *__pyx_t_5;
14268 Py_ssize_t *__pyx_t_6;
14269 __Pyx_RefNannySetupContext(
"__get__", 0);
14270 __Pyx_TraceCall(
"__get__", __pyx_f[1], 571, 0, __PYX_ERR(1, 571, __pyx_L1_error));
14279 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
14289 __Pyx_XDECREF(__pyx_r);
14290 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 573, __pyx_L1_error)
14291 __Pyx_GOTREF(__pyx_t_2);
14292 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__33, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 573, __pyx_L1_error)
14293 __Pyx_GOTREF(__pyx_t_3);
14294 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14295 __pyx_r = __pyx_t_3;
14315 __Pyx_XDECREF(__pyx_r);
14316 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 575, __pyx_L1_error)
14317 __Pyx_GOTREF(__pyx_t_3);
14318 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
14319 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
14320 __pyx_t_4 = __pyx_t_6;
14321 __pyx_v_suboffset = (__pyx_t_4[0]);
14322 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
14323 __Pyx_GOTREF(__pyx_t_2);
14324 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 575, __pyx_L1_error)
14325 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14327 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
14328 __Pyx_GOTREF(__pyx_t_2);
14329 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14330 __pyx_r = __pyx_t_2;
14344 __Pyx_XDECREF(__pyx_t_2);
14345 __Pyx_XDECREF(__pyx_t_3);
14346 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14349 __Pyx_XGIVEREF(__pyx_r);
14350 __Pyx_TraceReturn(__pyx_r, 0);
14351 __Pyx_RefNannyFinishContext();
14364 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
14365 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
14366 PyObject *__pyx_r = 0;
14367 __Pyx_RefNannyDeclarations
14368 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14369 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14372 __Pyx_RefNannyFinishContext();
14376 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14377 PyObject *__pyx_r = NULL;
14378 __Pyx_TraceDeclarations
14379 __Pyx_RefNannyDeclarations
14380 PyObject *__pyx_t_1 = NULL;
14381 __Pyx_RefNannySetupContext(
"__get__", 0);
14382 __Pyx_TraceCall(
"__get__", __pyx_f[1], 578, 0, __PYX_ERR(1, 578, __pyx_L1_error));
14391 __Pyx_XDECREF(__pyx_r);
14392 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 579, __pyx_L1_error)
14393 __Pyx_GOTREF(__pyx_t_1);
14394 __pyx_r = __pyx_t_1;
14408 __Pyx_XDECREF(__pyx_t_1);
14409 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14412 __Pyx_XGIVEREF(__pyx_r);
14413 __Pyx_TraceReturn(__pyx_r, 0);
14414 __Pyx_RefNannyFinishContext();
14427 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
14428 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
14429 PyObject *__pyx_r = 0;
14430 __Pyx_RefNannyDeclarations
14431 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14432 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14435 __Pyx_RefNannyFinishContext();
14439 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14440 PyObject *__pyx_r = NULL;
14441 __Pyx_TraceDeclarations
14442 __Pyx_RefNannyDeclarations
14443 PyObject *__pyx_t_1 = NULL;
14444 __Pyx_RefNannySetupContext(
"__get__", 0);
14445 __Pyx_TraceCall(
"__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
14454 __Pyx_XDECREF(__pyx_r);
14455 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
14456 __Pyx_GOTREF(__pyx_t_1);
14457 __pyx_r = __pyx_t_1;
14471 __Pyx_XDECREF(__pyx_t_1);
14472 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14475 __Pyx_XGIVEREF(__pyx_r);
14476 __Pyx_TraceReturn(__pyx_r, 0);
14477 __Pyx_RefNannyFinishContext();
14490 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
14491 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14492 PyObject *__pyx_r = 0;
14493 __Pyx_RefNannyDeclarations
14494 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14495 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14498 __Pyx_RefNannyFinishContext();
14502 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14503 PyObject *__pyx_r = NULL;
14504 __Pyx_TraceDeclarations
14505 __Pyx_RefNannyDeclarations
14506 PyObject *__pyx_t_1 = NULL;
14507 PyObject *__pyx_t_2 = NULL;
14508 PyObject *__pyx_t_3 = NULL;
14509 __Pyx_RefNannySetupContext(
"__get__", 0);
14510 __Pyx_TraceCall(
"__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
14519 __Pyx_XDECREF(__pyx_r);
14520 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
14521 __Pyx_GOTREF(__pyx_t_1);
14522 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 587, __pyx_L1_error)
14523 __Pyx_GOTREF(__pyx_t_2);
14524 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 587, __pyx_L1_error)
14525 __Pyx_GOTREF(__pyx_t_3);
14526 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14527 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14528 __pyx_r = __pyx_t_3;
14542 __Pyx_XDECREF(__pyx_t_1);
14543 __Pyx_XDECREF(__pyx_t_2);
14544 __Pyx_XDECREF(__pyx_t_3);
14545 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14548 __Pyx_XGIVEREF(__pyx_r);
14549 __Pyx_TraceReturn(__pyx_r, 0);
14550 __Pyx_RefNannyFinishContext();
14563 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
14564 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14565 PyObject *__pyx_r = 0;
14566 __Pyx_RefNannyDeclarations
14567 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14568 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14571 __Pyx_RefNannyFinishContext();
14575 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14576 PyObject *__pyx_v_result = NULL;
14577 PyObject *__pyx_v_length = NULL;
14578 PyObject *__pyx_r = NULL;
14579 __Pyx_TraceDeclarations
14580 __Pyx_RefNannyDeclarations
14583 Py_ssize_t *__pyx_t_3;
14584 Py_ssize_t *__pyx_t_4;
14585 Py_ssize_t *__pyx_t_5;
14586 PyObject *__pyx_t_6 = NULL;
14587 __Pyx_RefNannySetupContext(
"__get__", 0);
14588 __Pyx_TraceCall(
"__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
14597 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14598 __pyx_t_2 = (__pyx_t_1 != 0);
14608 __Pyx_INCREF(__pyx_int_1);
14609 __pyx_v_result = __pyx_int_1;
14618 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14619 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14620 __pyx_t_3 = __pyx_t_5;
14621 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
14622 __Pyx_GOTREF(__pyx_t_6);
14623 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14633 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 595, __pyx_L1_error)
14634 __Pyx_GOTREF(__pyx_t_6);
14635 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14646 __Pyx_INCREF(__pyx_v_result);
14647 __Pyx_GIVEREF(__pyx_v_result);
14648 __Pyx_GOTREF(__pyx_v_self->_size);
14649 __Pyx_DECREF(__pyx_v_self->_size);
14650 __pyx_v_self->_size = __pyx_v_result;
14668 __Pyx_XDECREF(__pyx_r);
14669 __Pyx_INCREF(__pyx_v_self->_size);
14670 __pyx_r = __pyx_v_self->_size;
14683 __Pyx_XDECREF(__pyx_t_6);
14684 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14687 __Pyx_XDECREF(__pyx_v_result);
14688 __Pyx_XDECREF(__pyx_v_length);
14689 __Pyx_XGIVEREF(__pyx_r);
14690 __Pyx_TraceReturn(__pyx_r, 0);
14691 __Pyx_RefNannyFinishContext();
14704 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
14705 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14706 Py_ssize_t __pyx_r;
14707 __Pyx_RefNannyDeclarations
14708 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
14709 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14712 __Pyx_RefNannyFinishContext();
14716 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14717 Py_ssize_t __pyx_r;
14718 __Pyx_TraceDeclarations
14719 __Pyx_RefNannyDeclarations
14721 __Pyx_RefNannySetupContext(
"__len__", 0);
14722 __Pyx_TraceCall(
"__len__", __pyx_f[1], 601, 0, __PYX_ERR(1, 601, __pyx_L1_error));
14731 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14741 __pyx_r = (__pyx_v_self->view.shape[0]);
14773 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14776 __Pyx_TraceReturn(Py_None, 0);
14777 __Pyx_RefNannyFinishContext();
14790 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
14791 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14792 PyObject *__pyx_r = 0;
14793 __Pyx_RefNannyDeclarations
14794 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
14795 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14798 __Pyx_RefNannyFinishContext();
14802 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14803 PyObject *__pyx_r = NULL;
14804 __Pyx_TraceDeclarations
14805 __Pyx_RefNannyDeclarations
14806 PyObject *__pyx_t_1 = NULL;
14807 PyObject *__pyx_t_2 = NULL;
14808 PyObject *__pyx_t_3 = NULL;
14809 __Pyx_RefNannySetupContext(
"__repr__", 0);
14810 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
14819 __Pyx_XDECREF(__pyx_r);
14820 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
14821 __Pyx_GOTREF(__pyx_t_1);
14822 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
14823 __Pyx_GOTREF(__pyx_t_2);
14824 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14825 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
14826 __Pyx_GOTREF(__pyx_t_1);
14827 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14836 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 609, __pyx_L1_error)
14837 __Pyx_GOTREF(__pyx_t_2);
14846 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 608, __pyx_L1_error)
14847 __Pyx_GOTREF(__pyx_t_3);
14848 __Pyx_GIVEREF(__pyx_t_1);
14849 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14850 __Pyx_GIVEREF(__pyx_t_2);
14851 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14854 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
14855 __Pyx_GOTREF(__pyx_t_2);
14856 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14857 __pyx_r = __pyx_t_2;
14871 __Pyx_XDECREF(__pyx_t_1);
14872 __Pyx_XDECREF(__pyx_t_2);
14873 __Pyx_XDECREF(__pyx_t_3);
14874 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14877 __Pyx_XGIVEREF(__pyx_r);
14878 __Pyx_TraceReturn(__pyx_r, 0);
14879 __Pyx_RefNannyFinishContext();
14892 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
14893 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14894 PyObject *__pyx_r = 0;
14895 __Pyx_RefNannyDeclarations
14896 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
14897 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14900 __Pyx_RefNannyFinishContext();
14904 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14905 PyObject *__pyx_r = NULL;
14906 __Pyx_TraceDeclarations
14907 __Pyx_RefNannyDeclarations
14908 PyObject *__pyx_t_1 = NULL;
14909 PyObject *__pyx_t_2 = NULL;
14910 __Pyx_RefNannySetupContext(
"__str__", 0);
14911 __Pyx_TraceCall(
"__str__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
14920 __Pyx_XDECREF(__pyx_r);
14921 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14922 __Pyx_GOTREF(__pyx_t_1);
14923 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14924 __Pyx_GOTREF(__pyx_t_2);
14925 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14926 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14927 __Pyx_GOTREF(__pyx_t_1);
14928 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14929 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14930 __Pyx_GOTREF(__pyx_t_2);
14931 __Pyx_GIVEREF(__pyx_t_1);
14932 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14934 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14935 __Pyx_GOTREF(__pyx_t_1);
14936 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14937 __pyx_r = __pyx_t_1;
14951 __Pyx_XDECREF(__pyx_t_1);
14952 __Pyx_XDECREF(__pyx_t_2);
14953 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14956 __Pyx_XGIVEREF(__pyx_r);
14957 __Pyx_TraceReturn(__pyx_r, 0);
14958 __Pyx_RefNannyFinishContext();
14971 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14972 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
14973 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14974 PyObject *__pyx_r = 0;
14975 __Pyx_RefNannyDeclarations
14976 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
14977 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14980 __Pyx_RefNannyFinishContext();
14984 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14985 __Pyx_memviewslice *__pyx_v_mslice;
14986 __Pyx_memviewslice __pyx_v_tmp;
14987 PyObject *__pyx_r = NULL;
14988 __Pyx_TraceDeclarations
14989 __Pyx_RefNannyDeclarations
14990 PyObject *__pyx_t_1 = NULL;
14991 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
14992 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
15001 __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
15010 __Pyx_XDECREF(__pyx_r);
15011 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 619, __pyx_L1_error)
15012 __Pyx_GOTREF(__pyx_t_1);
15013 __pyx_r = __pyx_t_1;
15027 __Pyx_XDECREF(__pyx_t_1);
15028 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15031 __Pyx_XGIVEREF(__pyx_r);
15032 __Pyx_TraceReturn(__pyx_r, 0);
15033 __Pyx_RefNannyFinishContext();
15046 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15047 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
15048 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15049 PyObject *__pyx_r = 0;
15050 __Pyx_RefNannyDeclarations
15051 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
15052 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15055 __Pyx_RefNannyFinishContext();
15059 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
15060 __Pyx_memviewslice *__pyx_v_mslice;
15061 __Pyx_memviewslice __pyx_v_tmp;
15062 PyObject *__pyx_r = NULL;
15063 __Pyx_TraceDeclarations
15064 __Pyx_RefNannyDeclarations
15065 PyObject *__pyx_t_1 = NULL;
15066 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
15067 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
15076 __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
15085 __Pyx_XDECREF(__pyx_r);
15086 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 625, __pyx_L1_error)
15087 __Pyx_GOTREF(__pyx_t_1);
15088 __pyx_r = __pyx_t_1;
15102 __Pyx_XDECREF(__pyx_t_1);
15103 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15106 __Pyx_XGIVEREF(__pyx_r);
15107 __Pyx_TraceReturn(__pyx_r, 0);
15108 __Pyx_RefNannyFinishContext();
15121 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15122 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
15123 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15124 PyObject *__pyx_r = 0;
15125 __Pyx_RefNannyDeclarations
15126 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
15127 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15130 __Pyx_RefNannyFinishContext();
15134 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
15135 __Pyx_memviewslice __pyx_v_mslice;
15137 PyObject *__pyx_r = NULL;
15138 __Pyx_TraceDeclarations
15139 __Pyx_RefNannyDeclarations
15140 __Pyx_memviewslice __pyx_t_1;
15141 PyObject *__pyx_t_2 = NULL;
15142 __Pyx_RefNannySetupContext(
"copy", 0);
15143 __Pyx_TraceCall(
"copy", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
15152 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
15161 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
15170 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 632, __pyx_L1_error)
15171 __pyx_v_mslice = __pyx_t_1;
15180 __Pyx_XDECREF(__pyx_r);
15181 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 637, __pyx_L1_error)
15182 __Pyx_GOTREF(__pyx_t_2);
15183 __pyx_r = __pyx_t_2;
15197 __Pyx_XDECREF(__pyx_t_2);
15198 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15201 __Pyx_XGIVEREF(__pyx_r);
15202 __Pyx_TraceReturn(__pyx_r, 0);
15203 __Pyx_RefNannyFinishContext();
15216 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15217 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
15218 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15219 PyObject *__pyx_r = 0;
15220 __Pyx_RefNannyDeclarations
15221 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
15222 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15225 __Pyx_RefNannyFinishContext();
15229 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
15230 __Pyx_memviewslice __pyx_v_src;
15231 __Pyx_memviewslice __pyx_v_dst;
15233 PyObject *__pyx_r = NULL;
15234 __Pyx_TraceDeclarations
15235 __Pyx_RefNannyDeclarations
15236 __Pyx_memviewslice __pyx_t_1;
15237 PyObject *__pyx_t_2 = NULL;
15238 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
15239 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 639, 0, __PYX_ERR(1, 639, __pyx_L1_error));
15248 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
15257 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
15266 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 644, __pyx_L1_error)
15267 __pyx_v_dst = __pyx_t_1;
15276 __Pyx_XDECREF(__pyx_r);
15277 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 649, __pyx_L1_error)
15278 __Pyx_GOTREF(__pyx_t_2);
15279 __pyx_r = __pyx_t_2;
15293 __Pyx_XDECREF(__pyx_t_2);
15294 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
15297 __Pyx_XGIVEREF(__pyx_r);
15298 __Pyx_TraceReturn(__pyx_r, 0);
15299 __Pyx_RefNannyFinishContext();
15310 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15311 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
15312 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15313 PyObject *__pyx_r = 0;
15314 __Pyx_RefNannyDeclarations
15315 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
15316 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15319 __Pyx_RefNannyFinishContext();
15323 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
15324 PyObject *__pyx_r = NULL;
15325 __Pyx_TraceDeclarations
15326 __Pyx_RefNannyDeclarations
15327 PyObject *__pyx_t_1 = NULL;
15328 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
15329 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
15337 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
15338 __Pyx_GOTREF(__pyx_t_1);
15339 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15340 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15341 __PYX_ERR(1, 2, __pyx_L1_error)
15351 __Pyx_XDECREF(__pyx_t_1);
15352 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15354 __Pyx_XGIVEREF(__pyx_r);
15355 __Pyx_TraceReturn(__pyx_r, 0);
15356 __Pyx_RefNannyFinishContext();
15368 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
15369 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
15370 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15371 PyObject *__pyx_r = 0;
15372 __Pyx_RefNannyDeclarations
15373 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
15374 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15377 __Pyx_RefNannyFinishContext();
15381 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15382 PyObject *__pyx_r = NULL;
15383 __Pyx_TraceDeclarations
15384 __Pyx_RefNannyDeclarations
15385 PyObject *__pyx_t_1 = NULL;
15386 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
15387 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
15394 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
15395 __Pyx_GOTREF(__pyx_t_1);
15396 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15397 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15398 __PYX_ERR(1, 4, __pyx_L1_error)
15409 __Pyx_XDECREF(__pyx_t_1);
15410 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15412 __Pyx_XGIVEREF(__pyx_r);
15413 __Pyx_TraceReturn(__pyx_r, 0);
15414 __Pyx_RefNannyFinishContext();
15426 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
15427 struct __pyx_memoryview_obj *__pyx_v_result = 0;
15428 PyObject *__pyx_r = NULL;
15429 __Pyx_TraceDeclarations
15430 __Pyx_RefNannyDeclarations
15431 PyObject *__pyx_t_1 = NULL;
15432 PyObject *__pyx_t_2 = NULL;
15433 PyObject *__pyx_t_3 = NULL;
15434 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
15435 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 653, 0, __PYX_ERR(1, 653, __pyx_L1_error));
15444 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 654, __pyx_L1_error)
15445 __Pyx_GOTREF(__pyx_t_1);
15446 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
15447 __Pyx_GOTREF(__pyx_t_2);
15448 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 654, __pyx_L1_error)
15449 __Pyx_GOTREF(__pyx_t_3);
15450 __Pyx_INCREF(__pyx_v_o);
15451 __Pyx_GIVEREF(__pyx_v_o);
15452 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
15453 __Pyx_GIVEREF(__pyx_t_1);
15454 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
15455 __Pyx_GIVEREF(__pyx_t_2);
15456 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15459 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
15460 __Pyx_GOTREF(__pyx_t_2);
15461 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15462 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
15472 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15481 __Pyx_XDECREF(__pyx_r);
15482 __Pyx_INCREF(((PyObject *)__pyx_v_result));
15483 __pyx_r = ((PyObject *)__pyx_v_result);
15496 __Pyx_XDECREF(__pyx_t_1);
15497 __Pyx_XDECREF(__pyx_t_2);
15498 __Pyx_XDECREF(__pyx_t_3);
15499 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15502 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15503 __Pyx_XGIVEREF(__pyx_r);
15504 __Pyx_TraceReturn(__pyx_r, 0);
15505 __Pyx_RefNannyFinishContext();
15517 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15519 __Pyx_TraceDeclarations
15520 __Pyx_RefNannyDeclarations
15522 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
15523 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
15532 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15533 __pyx_r = __pyx_t_1;
15546 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
15549 __Pyx_TraceReturn(Py_None, 0);
15550 __Pyx_RefNannyFinishContext();
15562 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
15563 PyObject *__pyx_v_tup = NULL;
15564 PyObject *__pyx_v_result = NULL;
15565 int __pyx_v_have_slices;
15566 int __pyx_v_seen_ellipsis;
15567 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15568 PyObject *__pyx_v_item = NULL;
15569 Py_ssize_t __pyx_v_nslices;
15570 PyObject *__pyx_r = NULL;
15571 __Pyx_TraceDeclarations
15572 __Pyx_RefNannyDeclarations
15575 PyObject *__pyx_t_3 = NULL;
15576 PyObject *__pyx_t_4 = NULL;
15577 Py_ssize_t __pyx_t_5;
15578 PyObject *(*__pyx_t_6)(PyObject *);
15579 PyObject *__pyx_t_7 = NULL;
15580 Py_ssize_t __pyx_t_8;
15583 PyObject *__pyx_t_11 = NULL;
15584 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
15585 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 662, 0, __PYX_ERR(1, 662, __pyx_L1_error));
15594 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15595 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15605 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 668, __pyx_L1_error)
15606 __Pyx_GOTREF(__pyx_t_3);
15607 __Pyx_INCREF(__pyx_v_index);
15608 __Pyx_GIVEREF(__pyx_v_index);
15609 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15610 __pyx_v_tup = __pyx_t_3;
15631 __Pyx_INCREF(__pyx_v_index);
15632 __pyx_v_tup = __pyx_v_index;
15643 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
15644 __Pyx_GOTREF(__pyx_t_3);
15645 __pyx_v_result = ((PyObject*)__pyx_t_3);
15655 __pyx_v_have_slices = 0;
15664 __pyx_v_seen_ellipsis = 0;
15673 __Pyx_INCREF(__pyx_int_0);
15674 __pyx_t_3 = __pyx_int_0;
15675 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15676 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15679 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 675, __pyx_L1_error)
15680 __Pyx_GOTREF(__pyx_t_4);
15681 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 675, __pyx_L1_error)
15684 if (likely(!__pyx_t_6)) {
15685 if (likely(PyList_CheckExact(__pyx_t_4))) {
15686 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
15687 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15688 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 675, __pyx_L1_error)
15690 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
15691 __Pyx_GOTREF(__pyx_t_7);
15694 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
15695 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15696 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 675, __pyx_L1_error)
15698 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
15699 __Pyx_GOTREF(__pyx_t_7);
15703 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15704 if (unlikely(!__pyx_t_7)) {
15705 PyObject* exc_type = PyErr_Occurred();
15707 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15708 else __PYX_ERR(1, 675, __pyx_L1_error)
15712 __Pyx_GOTREF(__pyx_t_7);
15714 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15716 __Pyx_INCREF(__pyx_t_3);
15717 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15718 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
15719 __Pyx_GOTREF(__pyx_t_7);
15720 __Pyx_DECREF(__pyx_t_3);
15721 __pyx_t_3 = __pyx_t_7;
15731 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15732 __pyx_t_1 = (__pyx_t_2 != 0);
15742 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15752 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
15753 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 678, __pyx_L1_error)
15754 __Pyx_GOTREF(__pyx_t_7);
15755 { Py_ssize_t __pyx_temp;
15756 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15757 __Pyx_INCREF(__pyx_slice__7);
15758 __Pyx_GIVEREF(__pyx_slice__7);
15759 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__7);
15762 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
15763 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15772 __pyx_v_seen_ellipsis = 1;
15792 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 681, __pyx_L1_error)
15803 __pyx_v_have_slices = 1;
15823 __pyx_t_2 = PySlice_Check(__pyx_v_item);
15824 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15827 __pyx_t_1 = __pyx_t_10;
15828 goto __pyx_L9_bool_binop_done;
15830 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15831 __pyx_t_1 = __pyx_t_10;
15832 __pyx_L9_bool_binop_done:;
15833 if (unlikely(__pyx_t_1)) {
15842 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 685, __pyx_L1_error)
15843 __Pyx_GOTREF(__pyx_t_7);
15844 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 685, __pyx_L1_error)
15845 __Pyx_GOTREF(__pyx_t_11);
15846 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15847 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15848 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15849 __PYX_ERR(1, 685, __pyx_L1_error)
15867 __pyx_t_10 = (__pyx_v_have_slices != 0);
15870 __pyx_t_1 = __pyx_t_10;
15871 goto __pyx_L11_bool_binop_done;
15873 __pyx_t_10 = PySlice_Check(__pyx_v_item);
15874 __pyx_t_2 = (__pyx_t_10 != 0);
15875 __pyx_t_1 = __pyx_t_2;
15876 __pyx_L11_bool_binop_done:;
15877 __pyx_v_have_slices = __pyx_t_1;
15886 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 688, __pyx_L1_error)
15898 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15899 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15908 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 690, __pyx_L1_error)
15909 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15918 __pyx_t_1 = (__pyx_v_nslices != 0);
15928 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error)
15929 __Pyx_GOTREF(__pyx_t_3);
15930 { Py_ssize_t __pyx_temp;
15931 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15932 __Pyx_INCREF(__pyx_slice__7);
15933 __Pyx_GIVEREF(__pyx_slice__7);
15934 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__7);
15937 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15938 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15956 __Pyx_XDECREF(__pyx_r);
15957 if (!__pyx_v_have_slices) {
15959 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
15960 __Pyx_GOTREF(__pyx_t_4);
15961 __pyx_t_3 = __pyx_t_4;
15963 goto __pyx_L14_bool_binop_done;
15965 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
15966 __Pyx_GOTREF(__pyx_t_4);
15967 __pyx_t_3 = __pyx_t_4;
15969 __pyx_L14_bool_binop_done:;
15970 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
15971 __Pyx_GOTREF(__pyx_t_4);
15972 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 694, __pyx_L1_error)
15973 __Pyx_GOTREF(__pyx_t_11);
15974 __Pyx_GIVEREF(__pyx_t_3);
15975 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15976 __Pyx_GIVEREF(__pyx_t_4);
15977 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15980 __pyx_r = ((PyObject*)__pyx_t_11);
15994 __Pyx_XDECREF(__pyx_t_3);
15995 __Pyx_XDECREF(__pyx_t_4);
15996 __Pyx_XDECREF(__pyx_t_7);
15997 __Pyx_XDECREF(__pyx_t_11);
15998 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
16001 __Pyx_XDECREF(__pyx_v_tup);
16002 __Pyx_XDECREF(__pyx_v_result);
16003 __Pyx_XDECREF(__pyx_v_idx);
16004 __Pyx_XDECREF(__pyx_v_item);
16005 __Pyx_XGIVEREF(__pyx_r);
16006 __Pyx_TraceReturn(__pyx_r, 0);
16007 __Pyx_RefNannyFinishContext();
16019 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
16020 Py_ssize_t __pyx_v_suboffset;
16021 PyObject *__pyx_r = NULL;
16022 __Pyx_TraceDeclarations
16023 __Pyx_RefNannyDeclarations
16024 Py_ssize_t *__pyx_t_1;
16025 Py_ssize_t *__pyx_t_2;
16026 Py_ssize_t *__pyx_t_3;
16028 PyObject *__pyx_t_5 = NULL;
16029 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
16030 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 696, 0, __PYX_ERR(1, 696, __pyx_L1_error));
16039 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
16040 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16041 __pyx_t_1 = __pyx_t_3;
16042 __pyx_v_suboffset = (__pyx_t_1[0]);
16051 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
16052 if (unlikely(__pyx_t_4)) {
16061 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 699, __pyx_L1_error)
16062 __Pyx_GOTREF(__pyx_t_5);
16063 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
16064 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16065 __PYX_ERR(1, 699, __pyx_L1_error)
16086 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16089 __Pyx_XDECREF(__pyx_t_5);
16090 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
16093 __Pyx_XGIVEREF(__pyx_r);
16094 __Pyx_TraceReturn(__pyx_r, 0);
16095 __Pyx_RefNannyFinishContext();
16107 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
16108 int __pyx_v_new_ndim;
16109 int __pyx_v_suboffset_dim;
16111 __Pyx_memviewslice __pyx_v_src;
16112 __Pyx_memviewslice __pyx_v_dst;
16113 __Pyx_memviewslice *__pyx_v_p_src;
16114 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
16115 __Pyx_memviewslice *__pyx_v_p_dst;
16116 int *__pyx_v_p_suboffset_dim;
16117 Py_ssize_t __pyx_v_start;
16118 Py_ssize_t __pyx_v_stop;
16119 Py_ssize_t __pyx_v_step;
16120 int __pyx_v_have_start;
16121 int __pyx_v_have_stop;
16122 int __pyx_v_have_step;
16123 PyObject *__pyx_v_index = NULL;
16124 struct __pyx_memoryview_obj *__pyx_r = NULL;
16125 __Pyx_TraceDeclarations
16126 __Pyx_RefNannyDeclarations
16129 PyObject *__pyx_t_3 = NULL;
16130 struct __pyx_memoryview_obj *__pyx_t_4;
16133 Py_ssize_t __pyx_t_7;
16134 PyObject *(*__pyx_t_8)(PyObject *);
16135 PyObject *__pyx_t_9 = NULL;
16136 Py_ssize_t __pyx_t_10;
16138 Py_ssize_t __pyx_t_12;
16139 __Pyx_RefNannySetupContext(
"memview_slice", 0);
16140 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 706, 0, __PYX_ERR(1, 706, __pyx_L1_error));
16149 __pyx_v_new_ndim = 0;
16150 __pyx_v_suboffset_dim = -1;
16159 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
16168 #ifndef CYTHON_WITHOUT_ASSERTIONS
16169 if (unlikely(!Py_OptimizeFlag)) {
16170 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
16171 PyErr_SetNone(PyExc_AssertionError);
16172 __PYX_ERR(1, 718, __pyx_L1_error)
16184 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16185 __pyx_t_2 = (__pyx_t_1 != 0);
16195 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 721, __pyx_L1_error)
16196 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16197 __Pyx_INCREF(__pyx_t_3);
16198 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16208 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
16228 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
16237 __pyx_v_p_src = (&__pyx_v_src);
16248 __pyx_t_4 = __pyx_v_p_src->memview;
16249 __pyx_v_dst.memview = __pyx_t_4;
16258 __pyx_t_5 = __pyx_v_p_src->data;
16259 __pyx_v_dst.data = __pyx_t_5;
16268 __pyx_v_p_dst = (&__pyx_v_dst);
16277 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
16287 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
16288 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
16291 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 742, __pyx_L1_error)
16292 __Pyx_GOTREF(__pyx_t_3);
16293 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 742, __pyx_L1_error)
16296 if (likely(!__pyx_t_8)) {
16297 if (likely(PyList_CheckExact(__pyx_t_3))) {
16298 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
16299 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16300 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 742, __pyx_L1_error)
16302 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
16303 __Pyx_GOTREF(__pyx_t_9);
16306 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
16307 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16308 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 742, __pyx_L1_error)
16310 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
16311 __Pyx_GOTREF(__pyx_t_9);
16315 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
16316 if (unlikely(!__pyx_t_9)) {
16317 PyObject* exc_type = PyErr_Occurred();
16319 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16320 else __PYX_ERR(1, 742, __pyx_L1_error)
16324 __Pyx_GOTREF(__pyx_t_9);
16326 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
16328 __pyx_v_dim = __pyx_t_6;
16329 __pyx_t_6 = (__pyx_t_6 + 1);
16338 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
16348 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
16357 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 744, __pyx_L1_error)
16376 __pyx_t_2 = (__pyx_v_index == Py_None);
16377 __pyx_t_1 = (__pyx_t_2 != 0);
16387 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
16396 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
16405 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
16414 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16434 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
16435 __Pyx_GOTREF(__pyx_t_9);
16436 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
16438 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16440 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
16441 __pyx_t_10 = __pyx_t_12;
16442 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16443 goto __pyx_L7_bool_binop_done;
16446 __pyx_L7_bool_binop_done:;
16447 __pyx_v_start = __pyx_t_10;
16456 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
16457 __Pyx_GOTREF(__pyx_t_9);
16458 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
16460 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16462 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
16463 __pyx_t_10 = __pyx_t_12;
16464 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16465 goto __pyx_L9_bool_binop_done;
16468 __pyx_L9_bool_binop_done:;
16469 __pyx_v_stop = __pyx_t_10;
16478 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 758, __pyx_L1_error)
16479 __Pyx_GOTREF(__pyx_t_9);
16480 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 758, __pyx_L1_error)
16482 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16484 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L1_error)
16485 __pyx_t_10 = __pyx_t_12;
16486 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16487 goto __pyx_L11_bool_binop_done;
16490 __pyx_L11_bool_binop_done:;
16491 __pyx_v_step = __pyx_t_10;
16500 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
16501 __Pyx_GOTREF(__pyx_t_9);
16502 __pyx_t_1 = (__pyx_t_9 != Py_None);
16503 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16504 __pyx_v_have_start = __pyx_t_1;
16513 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
16514 __Pyx_GOTREF(__pyx_t_9);
16515 __pyx_t_1 = (__pyx_t_9 != Py_None);
16516 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16517 __pyx_v_have_stop = __pyx_t_1;
16526 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
16527 __Pyx_GOTREF(__pyx_t_9);
16528 __pyx_t_1 = (__pyx_t_9 != Py_None);
16529 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16530 __pyx_v_have_step = __pyx_t_1;
16539 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 764, __pyx_L1_error)
16548 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16560 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16569 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16570 __pyx_t_2 = (__pyx_t_1 != 0);
16580 __Pyx_XDECREF(((PyObject *)__pyx_r));
16589 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
16598 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 775, __pyx_L1_error) }
16607 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 773, __pyx_L1_error)
16608 __Pyx_GOTREF(__pyx_t_3);
16609 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 773, __pyx_L1_error)
16610 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16631 __Pyx_XDECREF(((PyObject *)__pyx_r));
16640 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 778, __pyx_L1_error)
16641 __Pyx_GOTREF(__pyx_t_3);
16650 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 778, __pyx_L1_error)
16651 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16666 __Pyx_XDECREF(__pyx_t_3);
16667 __Pyx_XDECREF(__pyx_t_9);
16668 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16671 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16672 __Pyx_XDECREF(__pyx_v_index);
16673 __Pyx_XGIVEREF((PyObject *)__pyx_r);
16674 __Pyx_TraceReturn(__pyx_r, 0);
16675 __Pyx_RefNannyFinishContext();
16687 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
16688 Py_ssize_t __pyx_v_new_shape;
16689 int __pyx_v_negative_step;
16691 __Pyx_TraceDeclarations
16695 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 803, 1, __PYX_ERR(1, 803, __pyx_L1_error));
16704 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16714 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16724 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16742 __pyx_t_1 = (0 <= __pyx_v_start);
16744 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16746 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16756 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 828, __pyx_L1_error)
16785 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16788 __pyx_t_2 = __pyx_t_1;
16789 goto __pyx_L6_bool_binop_done;
16791 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16792 __pyx_t_2 = __pyx_t_1;
16793 __pyx_L6_bool_binop_done:;
16794 __pyx_v_negative_step = __pyx_t_2;
16803 __pyx_t_1 = (__pyx_v_have_step != 0);
16806 __pyx_t_2 = __pyx_t_1;
16807 goto __pyx_L9_bool_binop_done;
16809 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16810 __pyx_t_2 = __pyx_t_1;
16811 __pyx_L9_bool_binop_done:;
16821 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
16839 __pyx_t_2 = (__pyx_v_have_start != 0);
16849 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16859 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16868 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16906 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16916 __pyx_t_2 = (__pyx_v_negative_step != 0);
16926 __pyx_v_start = (__pyx_v_shape - 1);
16946 __pyx_v_start = __pyx_v_shape;
16978 __pyx_t_2 = (__pyx_v_negative_step != 0);
16988 __pyx_v_start = (__pyx_v_shape - 1);
17021 __pyx_t_2 = (__pyx_v_have_stop != 0);
17031 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17041 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
17050 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17088 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
17098 __pyx_v_stop = __pyx_v_shape;
17128 __pyx_t_2 = (__pyx_v_negative_step != 0);
17138 __pyx_v_stop = -1
L;
17158 __pyx_v_stop = __pyx_v_shape;
17171 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
17199 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
17208 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
17218 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
17236 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
17246 __pyx_v_new_shape = 0;
17264 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
17273 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
17282 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
17293 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
17303 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
17323 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
17324 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
17335 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17345 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
17355 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
17365 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
17393 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 895, __pyx_L1_error)
17415 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17450 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17452 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17454 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17459 __Pyx_TraceReturn(Py_None, 1);
17471 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17472 Py_ssize_t __pyx_v_shape;
17473 Py_ssize_t __pyx_v_stride;
17474 Py_ssize_t __pyx_v_suboffset;
17475 Py_ssize_t __pyx_v_itemsize;
17476 char *__pyx_v_resultp;
17478 __Pyx_TraceDeclarations
17479 __Pyx_RefNannyDeclarations
17480 Py_ssize_t __pyx_t_1;
17482 PyObject *__pyx_t_3 = NULL;
17483 PyObject *__pyx_t_4 = NULL;
17484 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
17485 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 906, 0, __PYX_ERR(1, 906, __pyx_L1_error));
17494 __pyx_v_suboffset = -1
L;
17503 __pyx_t_1 = __pyx_v_view->itemsize;
17504 __pyx_v_itemsize = __pyx_t_1;
17513 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17523 if (unlikely(__pyx_v_itemsize == 0)) {
17524 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
17525 __PYX_ERR(1, 913, __pyx_L1_error)
17527 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17528 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
17529 __PYX_ERR(1, 913, __pyx_L1_error)
17531 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17540 __pyx_v_stride = __pyx_v_itemsize;
17560 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17569 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17578 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17588 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17608 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17618 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17627 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17628 if (unlikely(__pyx_t_2)) {
17637 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
17638 __Pyx_GOTREF(__pyx_t_3);
17639 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 924, __pyx_L1_error)
17640 __Pyx_GOTREF(__pyx_t_4);
17641 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17642 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
17643 __Pyx_GOTREF(__pyx_t_3);
17644 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17645 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17646 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17647 __PYX_ERR(1, 924, __pyx_L1_error)
17674 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17675 if (unlikely(__pyx_t_2)) {
17684 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
17685 __Pyx_GOTREF(__pyx_t_3);
17686 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 927, __pyx_L1_error)
17687 __Pyx_GOTREF(__pyx_t_4);
17688 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17689 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
17690 __Pyx_GOTREF(__pyx_t_3);
17691 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17692 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17693 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17694 __PYX_ERR(1, 927, __pyx_L1_error)
17712 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17721 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17731 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17749 __pyx_r = __pyx_v_resultp;
17762 __Pyx_XDECREF(__pyx_t_3);
17763 __Pyx_XDECREF(__pyx_t_4);
17764 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17767 __Pyx_TraceReturn(Py_None, 0);
17768 __Pyx_RefNannyFinishContext();
17780 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17782 Py_ssize_t *__pyx_v_shape;
17783 Py_ssize_t *__pyx_v_strides;
17787 __Pyx_TraceDeclarations
17789 Py_ssize_t *__pyx_t_2;
17792 Py_ssize_t __pyx_t_5;
17793 Py_ssize_t __pyx_t_6;
17797 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 939, 1, __PYX_ERR(1, 939, __pyx_L1_error));
17806 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17807 __pyx_v_ndim = __pyx_t_1;
17816 __pyx_t_2 = __pyx_v_memslice->shape;
17817 __pyx_v_shape = __pyx_t_2;
17826 __pyx_t_2 = __pyx_v_memslice->strides;
17827 __pyx_v_strides = __pyx_t_2;
17836 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17837 __pyx_t_4 = __pyx_t_3;
17838 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17839 __pyx_v_i = __pyx_t_1;
17848 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17857 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17858 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17859 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17860 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17869 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17870 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17871 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17872 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17881 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17884 __pyx_t_7 = __pyx_t_8;
17885 goto __pyx_L6_bool_binop_done;
17887 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17888 __pyx_t_7 = __pyx_t_8;
17889 __pyx_L6_bool_binop_done:;
17899 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 953, __pyx_L1_error)
17933 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17935 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17937 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17942 __Pyx_TraceReturn(Py_None, 1);
17955 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
17956 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17957 __Pyx_RefNannyDeclarations
17958 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
17959 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17962 __Pyx_RefNannyFinishContext();
17965 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17966 __Pyx_TraceDeclarations
17967 __Pyx_RefNannyDeclarations
17968 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
17969 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 972, 0, __PYX_ERR(1, 972, __pyx_L1_error));
17978 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17991 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17993 __Pyx_TraceReturn(Py_None, 0);
17994 __Pyx_RefNannyFinishContext();
18005 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
18006 PyObject *__pyx_r = NULL;
18007 __Pyx_TraceDeclarations
18008 __Pyx_RefNannyDeclarations
18010 PyObject *__pyx_t_2 = NULL;
18011 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
18012 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 975, 0, __PYX_ERR(1, 975, __pyx_L1_error));
18021 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
18031 __Pyx_XDECREF(__pyx_r);
18032 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 977, __pyx_L1_error)
18033 __Pyx_GOTREF(__pyx_t_2);
18034 __pyx_r = __pyx_t_2;
18055 __Pyx_XDECREF(__pyx_r);
18056 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 979, __pyx_L1_error)
18057 __Pyx_GOTREF(__pyx_t_2);
18058 __pyx_r = __pyx_t_2;
18073 __Pyx_XDECREF(__pyx_t_2);
18074 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18077 __Pyx_XGIVEREF(__pyx_r);
18078 __Pyx_TraceReturn(__pyx_r, 0);
18079 __Pyx_RefNannyFinishContext();
18091 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
18092 PyObject *__pyx_r = NULL;
18093 __Pyx_TraceDeclarations
18094 __Pyx_RefNannyDeclarations
18097 PyObject *__pyx_t_3 = NULL;
18098 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
18099 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
18108 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
18118 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 983, __pyx_L1_error)
18138 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 985, __pyx_L1_error)
18139 __Pyx_GOTREF(__pyx_t_3);
18140 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18153 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18156 __Pyx_XDECREF(__pyx_t_3);
18157 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18160 __Pyx_XGIVEREF(__pyx_r);
18161 __Pyx_TraceReturn(__pyx_r, 0);
18162 __Pyx_RefNannyFinishContext();
18175 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
18176 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
18177 PyObject *__pyx_r = 0;
18178 __Pyx_RefNannyDeclarations
18179 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
18180 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18183 __Pyx_RefNannyFinishContext();
18187 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18188 PyObject *__pyx_r = NULL;
18189 __Pyx_TraceDeclarations
18190 __Pyx_RefNannyDeclarations
18191 __Pyx_RefNannySetupContext(
"__get__", 0);
18192 __Pyx_TraceCall(
"__get__", __pyx_f[1], 988, 0, __PYX_ERR(1, 988, __pyx_L1_error));
18201 __Pyx_XDECREF(__pyx_r);
18202 __Pyx_INCREF(__pyx_v_self->from_object);
18203 __pyx_r = __pyx_v_self->from_object;
18216 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18219 __Pyx_XGIVEREF(__pyx_r);
18220 __Pyx_TraceReturn(__pyx_r, 0);
18221 __Pyx_RefNannyFinishContext();
18232 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18233 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
18234 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18235 PyObject *__pyx_r = 0;
18236 __Pyx_RefNannyDeclarations
18237 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
18238 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18241 __Pyx_RefNannyFinishContext();
18245 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18246 PyObject *__pyx_r = NULL;
18247 __Pyx_TraceDeclarations
18248 __Pyx_RefNannyDeclarations
18249 PyObject *__pyx_t_1 = NULL;
18250 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
18251 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
18259 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18260 __Pyx_GOTREF(__pyx_t_1);
18261 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18262 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18263 __PYX_ERR(1, 2, __pyx_L1_error)
18273 __Pyx_XDECREF(__pyx_t_1);
18274 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18276 __Pyx_XGIVEREF(__pyx_r);
18277 __Pyx_TraceReturn(__pyx_r, 0);
18278 __Pyx_RefNannyFinishContext();
18290 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
18291 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
18292 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18293 PyObject *__pyx_r = 0;
18294 __Pyx_RefNannyDeclarations
18295 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
18296 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18299 __Pyx_RefNannyFinishContext();
18303 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18304 PyObject *__pyx_r = NULL;
18305 __Pyx_TraceDeclarations
18306 __Pyx_RefNannyDeclarations
18307 PyObject *__pyx_t_1 = NULL;
18308 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
18309 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
18316 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18317 __Pyx_GOTREF(__pyx_t_1);
18318 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18319 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18320 __PYX_ERR(1, 4, __pyx_L1_error)
18331 __Pyx_XDECREF(__pyx_t_1);
18332 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18334 __Pyx_XGIVEREF(__pyx_r);
18335 __Pyx_TraceReturn(__pyx_r, 0);
18336 __Pyx_RefNannyFinishContext();
18348 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
18349 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18350 Py_ssize_t __pyx_v_suboffset;
18351 PyObject *__pyx_v_length = NULL;
18352 PyObject *__pyx_r = NULL;
18353 __Pyx_TraceDeclarations
18354 __Pyx_RefNannyDeclarations
18356 PyObject *__pyx_t_2 = NULL;
18357 PyObject *__pyx_t_3 = NULL;
18358 __Pyx_TypeInfo *__pyx_t_4;
18359 Py_buffer __pyx_t_5;
18360 Py_ssize_t *__pyx_t_6;
18361 Py_ssize_t *__pyx_t_7;
18362 Py_ssize_t *__pyx_t_8;
18363 Py_ssize_t __pyx_t_9;
18364 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
18365 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 995, 0, __PYX_ERR(1, 995, __pyx_L1_error));
18374 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
18384 __Pyx_XDECREF(__pyx_r);
18385 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18404 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
18405 __Pyx_GOTREF(__pyx_t_2);
18406 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1009, __pyx_L1_error)
18407 __Pyx_GOTREF(__pyx_t_3);
18408 __Pyx_INCREF(Py_None);
18409 __Pyx_GIVEREF(Py_None);
18410 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
18411 __Pyx_INCREF(__pyx_int_0);
18412 __Pyx_GIVEREF(__pyx_int_0);
18413 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
18414 __Pyx_GIVEREF(__pyx_t_2);
18415 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18417 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
18418 __Pyx_GOTREF(__pyx_t_2);
18419 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18420 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18430 __pyx_v_result->from_slice = __pyx_v_memviewslice;
18439 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18448 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1014, __pyx_L1_error)
18449 __Pyx_GOTREF(__pyx_t_2);
18450 __Pyx_GIVEREF(__pyx_t_2);
18451 __Pyx_GOTREF(__pyx_v_result->from_object);
18452 __Pyx_DECREF(__pyx_v_result->from_object);
18453 __pyx_v_result->from_object = __pyx_t_2;
18463 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18464 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18473 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18474 __pyx_v_result->__pyx_base.view = __pyx_t_5;
18483 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
18492 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18501 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18510 Py_INCREF(Py_None);
18519 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18529 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18549 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18560 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18569 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18578 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18587 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18588 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18589 __pyx_t_6 = __pyx_t_8;
18590 __pyx_v_suboffset = (__pyx_t_6[0]);
18599 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18609 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18618 goto __pyx_L6_break;
18638 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18639 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18648 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18649 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18650 __pyx_t_6 = __pyx_t_8;
18651 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
18652 __Pyx_GOTREF(__pyx_t_2);
18653 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18663 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1040, __pyx_L1_error)
18664 __Pyx_GOTREF(__pyx_t_2);
18665 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1040, __pyx_L1_error)
18666 __Pyx_GOTREF(__pyx_t_3);
18667 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18668 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1040, __pyx_L1_error)
18669 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18670 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18680 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18689 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18698 __Pyx_XDECREF(__pyx_r);
18699 __Pyx_INCREF(((PyObject *)__pyx_v_result));
18700 __pyx_r = ((PyObject *)__pyx_v_result);
18713 __Pyx_XDECREF(__pyx_t_2);
18714 __Pyx_XDECREF(__pyx_t_3);
18715 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18718 __Pyx_XDECREF((PyObject *)__pyx_v_result);
18719 __Pyx_XDECREF(__pyx_v_length);
18720 __Pyx_XGIVEREF(__pyx_r);
18721 __Pyx_TraceReturn(__pyx_r, 0);
18722 __Pyx_RefNannyFinishContext();
18734 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18735 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18736 __Pyx_memviewslice *__pyx_r;
18737 __Pyx_TraceDeclarations
18738 __Pyx_RefNannyDeclarations
18741 PyObject *__pyx_t_3 = NULL;
18742 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
18743 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1048, 0, __PYX_ERR(1, 1048, __pyx_L1_error));
18752 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18753 __pyx_t_2 = (__pyx_t_1 != 0);
18763 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1052, __pyx_L1_error)
18764 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18765 __Pyx_INCREF(__pyx_t_3);
18766 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18776 __pyx_r = (&__pyx_v_obj->from_slice);
18796 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18805 __pyx_r = __pyx_v_mslice;
18819 __Pyx_XDECREF(__pyx_t_3);
18820 __Pyx_WriteUnraisable(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18823 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18824 __Pyx_TraceReturn(Py_None, 0);
18825 __Pyx_RefNannyFinishContext();
18837 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18839 Py_ssize_t *__pyx_v_shape;
18840 Py_ssize_t *__pyx_v_strides;
18841 Py_ssize_t *__pyx_v_suboffsets;
18842 __Pyx_TraceDeclarations
18843 __Pyx_RefNannyDeclarations
18844 Py_ssize_t *__pyx_t_1;
18848 Py_ssize_t __pyx_t_5;
18849 __Pyx_RefNannySetupContext(
"slice_copy", 0);
18850 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1059, 0, __PYX_ERR(1, 1059, __pyx_L1_error));
18859 __pyx_t_1 = __pyx_v_memview->view.shape;
18860 __pyx_v_shape = __pyx_t_1;
18869 __pyx_t_1 = __pyx_v_memview->view.strides;
18870 __pyx_v_strides = __pyx_t_1;
18879 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18880 __pyx_v_suboffsets = __pyx_t_1;
18889 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
18898 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
18907 __pyx_t_2 = __pyx_v_memview->view.ndim;
18908 __pyx_t_3 = __pyx_t_2;
18909 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18910 __pyx_v_dim = __pyx_t_4;
18919 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18928 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18937 if ((__pyx_v_suboffsets != 0)) {
18938 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18942 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18956 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18958 __Pyx_TraceReturn(Py_None, 0);
18959 __Pyx_RefNannyFinishContext();
18970 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
18971 __Pyx_memviewslice __pyx_v_memviewslice;
18972 PyObject *__pyx_r = NULL;
18973 __Pyx_TraceDeclarations
18974 __Pyx_RefNannyDeclarations
18975 PyObject *__pyx_t_1 = NULL;
18976 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
18977 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1076, 0, __PYX_ERR(1, 1076, __pyx_L1_error));
18986 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18995 __Pyx_XDECREF(__pyx_r);
18996 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1080, __pyx_L1_error)
18997 __Pyx_GOTREF(__pyx_t_1);
18998 __pyx_r = __pyx_t_1;
19012 __Pyx_XDECREF(__pyx_t_1);
19013 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
19016 __Pyx_XGIVEREF(__pyx_r);
19017 __Pyx_TraceReturn(__pyx_r, 0);
19018 __Pyx_RefNannyFinishContext();
19030 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
19031 PyObject *(*__pyx_v_to_object_func)(
char *);
19032 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
19033 PyObject *__pyx_r = NULL;
19034 __Pyx_TraceDeclarations
19035 __Pyx_RefNannyDeclarations
19038 PyObject *(*__pyx_t_3)(
char *);
19039 int (*__pyx_t_4)(
char *, PyObject *);
19040 PyObject *__pyx_t_5 = NULL;
19041 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
19042 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1083, 0, __PYX_ERR(1, 1083, __pyx_L1_error));
19051 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19052 __pyx_t_2 = (__pyx_t_1 != 0);
19062 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
19063 __pyx_v_to_object_func = __pyx_t_3;
19072 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
19073 __pyx_v_to_dtype_func = __pyx_t_4;
19093 __pyx_v_to_object_func = NULL;
19102 __pyx_v_to_dtype_func = NULL;
19113 __Pyx_XDECREF(__pyx_r);
19122 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1097, __pyx_L1_error)
19123 __Pyx_GOTREF(__pyx_t_5);
19124 __pyx_r = __pyx_t_5;
19138 __Pyx_XDECREF(__pyx_t_5);
19139 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19142 __Pyx_XGIVEREF(__pyx_r);
19143 __Pyx_TraceReturn(__pyx_r, 0);
19144 __Pyx_RefNannyFinishContext();
19156 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
19157 Py_ssize_t __pyx_r;
19158 __Pyx_TraceDeclarations
19160 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1105, 1, __PYX_ERR(1, 1105, __pyx_L1_error));
19169 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
19179 __pyx_r = (-__pyx_v_arg);
19199 __pyx_r = __pyx_v_arg;
19213 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19216 __Pyx_TraceReturn(Py_None, 1);
19228 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
19230 Py_ssize_t __pyx_v_c_stride;
19231 Py_ssize_t __pyx_v_f_stride;
19233 __Pyx_TraceDeclarations
19238 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1112, 1, __PYX_ERR(1, 1112, __pyx_L1_error));
19247 __pyx_v_c_stride = 0;
19256 __pyx_v_f_stride = 0;
19265 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19266 __pyx_v_i = __pyx_t_1;
19275 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19285 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19294 goto __pyx_L4_break;
19314 __pyx_t_1 = __pyx_v_ndim;
19315 __pyx_t_3 = __pyx_t_1;
19316 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19317 __pyx_v_i = __pyx_t_4;
19326 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19336 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19345 goto __pyx_L7_break;
19365 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19409 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19412 __Pyx_TraceReturn(Py_None, 1);
19424 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
19425 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19426 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19427 Py_ssize_t __pyx_v_dst_extent;
19428 Py_ssize_t __pyx_v_src_stride;
19429 Py_ssize_t __pyx_v_dst_stride;
19433 Py_ssize_t __pyx_t_4;
19434 Py_ssize_t __pyx_t_5;
19435 Py_ssize_t __pyx_t_6;
19444 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19453 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19462 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19471 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19480 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19490 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19493 __pyx_t_1 = __pyx_t_2;
19494 goto __pyx_L5_bool_binop_done;
19496 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19499 __pyx_t_1 = __pyx_t_2;
19500 goto __pyx_L5_bool_binop_done;
19510 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19512 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19514 __pyx_t_3 = (__pyx_t_2 != 0);
19515 __pyx_t_1 = __pyx_t_3;
19516 __pyx_L5_bool_binop_done:;
19534 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19554 __pyx_t_4 = __pyx_v_dst_extent;
19555 __pyx_t_5 = __pyx_t_4;
19556 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19557 __pyx_v_i = __pyx_t_6;
19566 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19575 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19584 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19607 __pyx_t_4 = __pyx_v_dst_extent;
19608 __pyx_t_5 = __pyx_t_4;
19609 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19610 __pyx_v_i = __pyx_t_6;
19619 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19628 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19637 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19661 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
19662 __Pyx_TraceDeclarations
19663 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1166, 1, __PYX_ERR(1, 1166, __pyx_L1_error));
19672 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19685 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19687 __Pyx_TraceReturn(Py_None, 1);
19698 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
19700 Py_ssize_t __pyx_v_size;
19701 Py_ssize_t __pyx_r;
19702 __Pyx_TraceDeclarations
19703 Py_ssize_t __pyx_t_1;
19707 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1173, 1, __PYX_ERR(1, 1173, __pyx_L1_error));
19716 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19717 __pyx_v_size = __pyx_t_1;
19726 __pyx_t_2 = __pyx_v_ndim;
19727 __pyx_t_3 = __pyx_t_2;
19728 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19729 __pyx_v_i = __pyx_t_4;
19738 __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
19748 __pyx_r = __pyx_v_size;
19761 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19764 __Pyx_TraceReturn(Py_None, 1);
19776 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
19778 Py_ssize_t __pyx_r;
19779 __Pyx_TraceDeclarations
19784 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1184, 1, __PYX_ERR(1, 1184, __pyx_L1_error));
19793 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
19803 __pyx_t_2 = __pyx_v_ndim;
19804 __pyx_t_3 = __pyx_t_2;
19805 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19806 __pyx_v_idx = __pyx_t_4;
19815 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19824 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19845 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19846 __pyx_v_idx = __pyx_t_2;
19855 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19864 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19876 __pyx_r = __pyx_v_stride;
19889 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19892 __Pyx_TraceReturn(Py_None, 1);
19904 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
19906 void *__pyx_v_result;
19907 size_t __pyx_v_itemsize;
19908 size_t __pyx_v_size;
19910 __Pyx_TraceDeclarations
19911 Py_ssize_t __pyx_t_1;
19914 struct __pyx_memoryview_obj *__pyx_t_4;
19917 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1205, 1, __PYX_ERR(1, 1205, __pyx_L1_error));
19926 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19927 __pyx_v_itemsize = __pyx_t_1;
19936 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19945 __pyx_v_result = malloc(__pyx_v_size);
19954 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19964 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
19982 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
19991 __pyx_t_4 = __pyx_v_src->memview;
19992 __pyx_v_tmpslice->memview = __pyx_t_4;
20001 __pyx_t_3 = __pyx_v_ndim;
20002 __pyx_t_5 = __pyx_t_3;
20003 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20004 __pyx_v_i = __pyx_t_6;
20013 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
20022 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
20032 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
20041 __pyx_t_3 = __pyx_v_ndim;
20042 __pyx_t_5 = __pyx_t_3;
20043 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20044 __pyx_v_i = __pyx_t_6;
20053 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
20063 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
20082 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
20092 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
20112 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
20123 __pyx_r = __pyx_v_result;
20138 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20140 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
20142 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20147 __Pyx_TraceReturn(Py_None, 1);
20159 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
20161 __Pyx_TraceDeclarations
20162 __Pyx_RefNannyDeclarations
20163 PyObject *__pyx_t_1 = NULL;
20164 PyObject *__pyx_t_2 = NULL;
20165 PyObject *__pyx_t_3 = NULL;
20166 PyObject *__pyx_t_4 = NULL;
20168 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20170 __Pyx_RefNannySetupContext(
"_err_extents", 0);
20171 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1248, 0, __PYX_ERR(1, 1248, __pyx_L1_error));
20180 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1251, __pyx_L1_error)
20181 __Pyx_GOTREF(__pyx_t_1);
20182 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1251, __pyx_L1_error)
20183 __Pyx_GOTREF(__pyx_t_2);
20184 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1251, __pyx_L1_error)
20185 __Pyx_GOTREF(__pyx_t_3);
20186 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1251, __pyx_L1_error)
20187 __Pyx_GOTREF(__pyx_t_4);
20188 __Pyx_GIVEREF(__pyx_t_1);
20189 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
20190 __Pyx_GIVEREF(__pyx_t_2);
20191 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
20192 __Pyx_GIVEREF(__pyx_t_3);
20193 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
20205 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
20206 __Pyx_GOTREF(__pyx_t_3);
20207 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20208 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
20209 __Pyx_GOTREF(__pyx_t_4);
20210 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20211 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20212 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20213 __PYX_ERR(1, 1250, __pyx_L1_error)
20225 __Pyx_XDECREF(__pyx_t_1);
20226 __Pyx_XDECREF(__pyx_t_2);
20227 __Pyx_XDECREF(__pyx_t_3);
20228 __Pyx_XDECREF(__pyx_t_4);
20229 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20231 __Pyx_TraceReturn(Py_None, 0);
20232 __Pyx_RefNannyFinishContext();
20234 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20247 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
20249 __Pyx_TraceDeclarations
20250 __Pyx_RefNannyDeclarations
20251 PyObject *__pyx_t_1 = NULL;
20252 PyObject *__pyx_t_2 = NULL;
20253 PyObject *__pyx_t_3 = NULL;
20254 PyObject *__pyx_t_4 = NULL;
20256 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20258 __Pyx_RefNannySetupContext(
"_err_dim", 0);
20259 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1254, 0, __PYX_ERR(1, 1254, __pyx_L1_error));
20260 __Pyx_INCREF(__pyx_v_error);
20269 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1255, __pyx_L1_error)
20270 __Pyx_GOTREF(__pyx_t_2);
20271 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
20272 __Pyx_GOTREF(__pyx_t_3);
20273 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
20274 __Pyx_GOTREF(__pyx_t_4);
20275 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20276 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20277 __Pyx_INCREF(__pyx_v_error);
20278 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
20279 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
20280 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20281 if (likely(__pyx_t_2)) {
20282 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
20283 __Pyx_INCREF(__pyx_t_2);
20284 __Pyx_INCREF(
function);
20285 __Pyx_DECREF_SET(__pyx_t_3,
function);
20288 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
20289 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20290 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20291 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1255, __pyx_L1_error)
20292 __Pyx_GOTREF(__pyx_t_1);
20293 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20294 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20295 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20296 __PYX_ERR(1, 1255, __pyx_L1_error)
20308 __Pyx_XDECREF(__pyx_t_1);
20309 __Pyx_XDECREF(__pyx_t_2);
20310 __Pyx_XDECREF(__pyx_t_3);
20311 __Pyx_XDECREF(__pyx_t_4);
20312 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
20314 __Pyx_XDECREF(__pyx_v_error);
20315 __Pyx_TraceReturn(Py_None, 0);
20316 __Pyx_RefNannyFinishContext();
20318 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20331 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
20333 __Pyx_TraceDeclarations
20334 __Pyx_RefNannyDeclarations
20336 PyObject *__pyx_t_2 = NULL;
20337 PyObject *__pyx_t_3 = NULL;
20338 PyObject *__pyx_t_4 = NULL;
20339 PyObject *__pyx_t_5 = NULL;
20341 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20343 __Pyx_RefNannySetupContext(
"_err", 0);
20344 __Pyx_TraceCall(
"_err", __pyx_f[1], 1258, 0, __PYX_ERR(1, 1258, __pyx_L1_error));
20345 __Pyx_INCREF(__pyx_v_error);
20354 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
20355 if (unlikely(__pyx_t_1)) {
20364 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
20365 __Pyx_GOTREF(__pyx_t_3);
20366 __Pyx_INCREF(__pyx_v_error);
20367 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
20368 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20369 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20370 if (likely(__pyx_t_5)) {
20371 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
20372 __Pyx_INCREF(__pyx_t_5);
20373 __Pyx_INCREF(
function);
20374 __Pyx_DECREF_SET(__pyx_t_4,
function);
20377 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
20378 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20379 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20380 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
20381 __Pyx_GOTREF(__pyx_t_2);
20382 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20383 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20384 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20385 __PYX_ERR(1, 1260, __pyx_L1_error)
20404 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20405 __PYX_ERR(1, 1262, __pyx_L1_error)
20418 __Pyx_XDECREF(__pyx_t_2);
20419 __Pyx_XDECREF(__pyx_t_3);
20420 __Pyx_XDECREF(__pyx_t_4);
20421 __Pyx_XDECREF(__pyx_t_5);
20422 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20424 __Pyx_XDECREF(__pyx_v_error);
20425 __Pyx_TraceReturn(Py_None, 0);
20426 __Pyx_RefNannyFinishContext();
20428 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20441 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
20442 void *__pyx_v_tmpdata;
20443 size_t __pyx_v_itemsize;
20445 char __pyx_v_order;
20446 int __pyx_v_broadcasting;
20447 int __pyx_v_direct_copy;
20448 __Pyx_memviewslice __pyx_v_tmp;
20451 __Pyx_TraceDeclarations
20452 Py_ssize_t __pyx_t_1;
20460 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1265, 1, __PYX_ERR(1, 1265, __pyx_L1_error));
20469 __pyx_v_tmpdata = NULL;
20478 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20479 __pyx_v_itemsize = __pyx_t_1;
20488 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20497 __pyx_v_broadcasting = 0;
20506 __pyx_v_direct_copy = 0;
20515 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20525 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20544 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20554 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20573 __pyx_t_3 = __pyx_v_dst_ndim;
20574 __pyx_t_4 = __pyx_v_src_ndim;
20575 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20576 __pyx_t_5 = __pyx_t_3;
20578 __pyx_t_5 = __pyx_t_4;
20580 __pyx_v_ndim = __pyx_t_5;
20589 __pyx_t_5 = __pyx_v_ndim;
20590 __pyx_t_3 = __pyx_t_5;
20591 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20592 __pyx_v_i = __pyx_t_4;
20601 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20611 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20621 __pyx_v_broadcasting = 1;
20630 (__pyx_v_src.strides[__pyx_v_i]) = 0;
20650 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
20670 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20680 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
20699 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20709 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20719 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20737 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
20738 __pyx_v_tmpdata = __pyx_t_7;
20747 __pyx_v_src = __pyx_v_tmp;
20765 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20775 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
20785 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
20804 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
20814 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
20833 __pyx_t_2 = (__pyx_v_direct_copy != 0);
20843 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20852 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20861 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20870 free(__pyx_v_tmpdata);
20907 __pyx_t_2 = (__pyx_v_order ==
'F');
20909 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20911 __pyx_t_8 = (__pyx_t_2 != 0);
20921 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
20930 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1327, __pyx_L1_error)
20948 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20957 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20966 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20975 free(__pyx_v_tmpdata);
20999 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21001 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
21003 __Pyx_PyGILState_Release(__pyx_gilstate_save);
21008 __Pyx_TraceReturn(Py_None, 1);
21020 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
21022 int __pyx_v_offset;
21023 __Pyx_TraceDeclarations
21027 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1337, 1, __PYX_ERR(1, 1337, __pyx_L1_error));
21036 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
21045 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
21046 __pyx_v_i = __pyx_t_1;
21055 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
21064 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
21073 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
21083 __pyx_t_1 = __pyx_v_offset;
21084 __pyx_t_2 = __pyx_t_1;
21085 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21086 __pyx_v_i = __pyx_t_3;
21095 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
21104 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
21113 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
21127 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21129 __Pyx_TraceReturn(Py_None, 1);
21140 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
21141 __Pyx_TraceDeclarations
21143 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1359, 1, __PYX_ERR(1, 1359, __pyx_L1_error));
21152 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
21162 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
21184 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21186 __Pyx_TraceReturn(Py_None, 1);
21197 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
21198 __Pyx_TraceDeclarations
21199 __Pyx_RefNannyDeclarations
21201 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21203 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
21204 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1368, 0, __PYX_ERR(1, 1368, __pyx_L1_error));
21213 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
21226 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
21228 __Pyx_TraceReturn(Py_None, 0);
21229 __Pyx_RefNannyFinishContext();
21231 __Pyx_PyGILState_Release(__pyx_gilstate_save);
21243 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
21244 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21245 __Pyx_TraceDeclarations
21246 __Pyx_RefNannyDeclarations
21247 Py_ssize_t __pyx_t_1;
21248 Py_ssize_t __pyx_t_2;
21249 Py_ssize_t __pyx_t_3;
21251 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
21252 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1374, 0, __PYX_ERR(1, 1374, __pyx_L1_error));
21261 __pyx_t_1 = (__pyx_v_shape[0]);
21262 __pyx_t_2 = __pyx_t_1;
21263 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21264 __pyx_v_i = __pyx_t_3;
21273 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
21283 __pyx_t_4 = (__pyx_v_inc != 0);
21293 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
21313 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
21343 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
21354 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21368 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
21370 __Pyx_TraceReturn(Py_None, 0);
21371 __Pyx_RefNannyFinishContext();
21382 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
21383 __Pyx_TraceDeclarations
21384 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1394, 1, __PYX_ERR(1, 1394, __pyx_L1_error));
21393 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21402 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21411 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21424 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21426 __Pyx_TraceReturn(Py_None, 1);
21437 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
21438 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21439 Py_ssize_t __pyx_v_stride;
21440 Py_ssize_t __pyx_v_extent;
21441 __Pyx_TraceDeclarations
21443 Py_ssize_t __pyx_t_2;
21444 Py_ssize_t __pyx_t_3;
21445 Py_ssize_t __pyx_t_4;
21446 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1404, 1, __PYX_ERR(1, 1404, __pyx_L1_error));
21455 __pyx_v_stride = (__pyx_v_strides[0]);
21464 __pyx_v_extent = (__pyx_v_shape[0]);
21473 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21483 __pyx_t_2 = __pyx_v_extent;
21484 __pyx_t_3 = __pyx_t_2;
21485 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21486 __pyx_v_i = __pyx_t_4;
21495 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21504 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21525 __pyx_t_2 = __pyx_v_extent;
21526 __pyx_t_3 = __pyx_t_2;
21527 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21528 __pyx_v_i = __pyx_t_4;
21537 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21546 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21562 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21564 __Pyx_TraceReturn(Py_None, 1);
21574 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
21575 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21576 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21577 PyObject *__pyx_v___pyx_type = 0;
21578 long __pyx_v___pyx_checksum;
21579 PyObject *__pyx_v___pyx_state = 0;
21580 PyObject *__pyx_r = 0;
21581 __Pyx_RefNannyDeclarations
21582 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
21584 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21585 PyObject* values[3] = {0,0,0};
21586 if (unlikely(__pyx_kwds)) {
21587 Py_ssize_t kw_args;
21588 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21589 switch (pos_args) {
21590 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21591 CYTHON_FALLTHROUGH;
21592 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21593 CYTHON_FALLTHROUGH;
21594 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21595 CYTHON_FALLTHROUGH;
21597 default:
goto __pyx_L5_argtuple_error;
21599 kw_args = PyDict_Size(__pyx_kwds);
21600 switch (pos_args) {
21602 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21603 else goto __pyx_L5_argtuple_error;
21604 CYTHON_FALLTHROUGH;
21606 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21608 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
21610 CYTHON_FALLTHROUGH;
21612 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21614 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
21617 if (unlikely(kw_args > 0)) {
21618 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
21620 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21621 goto __pyx_L5_argtuple_error;
21623 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21624 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21625 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21627 __pyx_v___pyx_type = values[0];
21628 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
21629 __pyx_v___pyx_state = values[2];
21631 goto __pyx_L4_argument_unpacking_done;
21632 __pyx_L5_argtuple_error:;
21633 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
21635 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21636 __Pyx_RefNannyFinishContext();
21638 __pyx_L4_argument_unpacking_done:;
21639 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21642 __Pyx_RefNannyFinishContext();
21646 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21647 PyObject *__pyx_v___pyx_PickleError = 0;
21648 PyObject *__pyx_v___pyx_result = 0;
21649 PyObject *__pyx_r = NULL;
21650 __Pyx_TraceDeclarations
21651 __Pyx_RefNannyDeclarations
21653 PyObject *__pyx_t_2 = NULL;
21654 PyObject *__pyx_t_3 = NULL;
21655 PyObject *__pyx_t_4 = NULL;
21656 PyObject *__pyx_t_5 = NULL;
21658 __Pyx_TraceFrameInit(__pyx_codeobj__39)
21659 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
21660 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
21669 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21679 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21680 __Pyx_GOTREF(__pyx_t_2);
21681 __Pyx_INCREF(__pyx_n_s_PickleError);
21682 __Pyx_GIVEREF(__pyx_n_s_PickleError);
21683 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21684 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21685 __Pyx_GOTREF(__pyx_t_3);
21686 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21687 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21688 __Pyx_GOTREF(__pyx_t_2);
21689 __Pyx_INCREF(__pyx_t_2);
21690 __pyx_v___pyx_PickleError = __pyx_t_2;
21691 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21692 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21701 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
21702 __Pyx_GOTREF(__pyx_t_2);
21703 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
21704 __Pyx_GOTREF(__pyx_t_4);
21705 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21706 __Pyx_INCREF(__pyx_v___pyx_PickleError);
21707 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21708 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21709 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21710 if (likely(__pyx_t_5)) {
21711 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21712 __Pyx_INCREF(__pyx_t_5);
21713 __Pyx_INCREF(
function);
21714 __Pyx_DECREF_SET(__pyx_t_2,
function);
21717 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21718 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21719 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21720 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
21721 __Pyx_GOTREF(__pyx_t_3);
21722 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21723 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21724 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21725 __PYX_ERR(1, 6, __pyx_L1_error)
21743 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
21744 __Pyx_GOTREF(__pyx_t_2);
21746 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21747 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21748 if (likely(__pyx_t_4)) {
21749 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21750 __Pyx_INCREF(__pyx_t_4);
21751 __Pyx_INCREF(
function);
21752 __Pyx_DECREF_SET(__pyx_t_2,
function);
21755 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21756 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21757 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21758 __Pyx_GOTREF(__pyx_t_3);
21759 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21760 __pyx_v___pyx_result = __pyx_t_3;
21770 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21771 __pyx_t_6 = (__pyx_t_1 != 0);
21781 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
21782 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
21783 __Pyx_GOTREF(__pyx_t_3);
21784 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21802 __Pyx_XDECREF(__pyx_r);
21803 __Pyx_INCREF(__pyx_v___pyx_result);
21804 __pyx_r = __pyx_v___pyx_result;
21815 __Pyx_XDECREF(__pyx_t_2);
21816 __Pyx_XDECREF(__pyx_t_3);
21817 __Pyx_XDECREF(__pyx_t_4);
21818 __Pyx_XDECREF(__pyx_t_5);
21819 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21822 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21823 __Pyx_XDECREF(__pyx_v___pyx_result);
21824 __Pyx_XGIVEREF(__pyx_r);
21825 __Pyx_TraceReturn(__pyx_r, 0);
21826 __Pyx_RefNannyFinishContext();
21838 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21839 PyObject *__pyx_r = NULL;
21840 __Pyx_TraceDeclarations
21841 __Pyx_RefNannyDeclarations
21842 PyObject *__pyx_t_1 = NULL;
21844 Py_ssize_t __pyx_t_3;
21847 PyObject *__pyx_t_6 = NULL;
21848 PyObject *__pyx_t_7 = NULL;
21849 PyObject *__pyx_t_8 = NULL;
21850 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
21851 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
21860 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21861 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21862 __PYX_ERR(1, 12, __pyx_L1_error)
21864 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21865 __Pyx_GOTREF(__pyx_t_1);
21866 __Pyx_GIVEREF(__pyx_t_1);
21867 __Pyx_GOTREF(__pyx_v___pyx_result->name);
21868 __Pyx_DECREF(__pyx_v___pyx_result->name);
21869 __pyx_v___pyx_result->name = __pyx_t_1;
21878 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21879 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
21880 __PYX_ERR(1, 13, __pyx_L1_error)
21882 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21883 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21886 __pyx_t_2 = __pyx_t_4;
21887 goto __pyx_L4_bool_binop_done;
21889 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21890 __pyx_t_5 = (__pyx_t_4 != 0);
21891 __pyx_t_2 = __pyx_t_5;
21892 __pyx_L4_bool_binop_done:;
21900 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21901 __Pyx_GOTREF(__pyx_t_6);
21902 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21903 __Pyx_GOTREF(__pyx_t_7);
21904 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21905 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21906 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21907 __PYX_ERR(1, 14, __pyx_L1_error)
21909 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21910 __Pyx_GOTREF(__pyx_t_6);
21912 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21913 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21914 if (likely(__pyx_t_8)) {
21915 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21916 __Pyx_INCREF(__pyx_t_8);
21917 __Pyx_INCREF(
function);
21918 __Pyx_DECREF_SET(__pyx_t_7,
function);
21921 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21922 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21923 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21924 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21925 __Pyx_GOTREF(__pyx_t_1);
21926 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21927 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21946 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21949 __Pyx_XDECREF(__pyx_t_1);
21950 __Pyx_XDECREF(__pyx_t_6);
21951 __Pyx_XDECREF(__pyx_t_7);
21952 __Pyx_XDECREF(__pyx_t_8);
21953 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21956 __Pyx_XGIVEREF(__pyx_r);
21957 __Pyx_TraceReturn(__pyx_r, 0);
21958 __Pyx_RefNannyFinishContext();
21962 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21963 struct __pyx_obj_18BoundaryConditions_BC_Base *p;
21965 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21966 o = (*t->tp_alloc)(t, 0);
21968 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21970 if (unlikely(!o))
return 0;
21971 p = ((
struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
21972 p->Shape = Py_None; Py_INCREF(Py_None);
21973 p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
21974 p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
21975 p->ct = Py_None; Py_INCREF(Py_None);
21976 p->_b_or.data = NULL;
21977 p->_b_or.memview = NULL;
21981 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
21982 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21983 #if CYTHON_USE_TP_FINALIZE
21984 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21985 if (PyObject_CallFinalizerFromDealloc(o))
return;
21988 PyObject_GC_UnTrack(o);
21989 Py_CLEAR(p->Shape);
21991 Py_CLEAR(p->BC_type);
21993 __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
21994 (*Py_TYPE(o)->tp_free)(o);
21997 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc
v,
void *a) {
21999 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
22001 e = (*v)(p->Shape, a);
if (e)
return e;
22004 e = (*v)(p->ct, a);
if (e)
return e;
22009 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
22011 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
22012 tmp = ((PyObject*)p->Shape);
22013 p->Shape = Py_None; Py_INCREF(Py_None);
22015 tmp = ((PyObject*)p->ct);
22016 p->ct = Py_None; Py_INCREF(Py_None);
22021 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED
void *x) {
22022 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
22025 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
22027 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o,
v);
22030 PyErr_SetString(PyExc_NotImplementedError,
"__del__");
22035 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED
void *x) {
22036 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
22039 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
22041 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o,
v);
22044 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
22048 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED
void *x) {
22049 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
22052 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
22054 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o,
v);
22057 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
22061 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED
void *x) {
22062 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
22065 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
22067 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o,
v);
22070 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
22074 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED
void *x) {
22075 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
22078 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
22080 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o,
v);
22083 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
22087 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
22088 {
"getContext", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
22089 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__},
22090 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__},
22094 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
22095 {(
char *)
"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (
char *)
"nd: 'int'", 0},
22096 {(
char *)
"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (
char *)
"Shape: object", 0},
22097 {(
char *)
"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (
char *)
"name: str", 0},
22098 {(
char *)
"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (
char *)
"BC_type: str", 0},
22099 {(
char *)
"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (
char *)
"ct: object", 0},
22103 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
22104 PyVarObject_HEAD_INIT(0, 0)
22105 "BoundaryConditions.BC_Base",
22106 sizeof(
struct __pyx_obj_18BoundaryConditions_BC_Base),
22108 __pyx_tp_dealloc_18BoundaryConditions_BC_Base,
22112 #if PY_MAJOR_VERSION < 3
22115 #if PY_MAJOR_VERSION >= 3
22128 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22129 "BC_Base(shape=None, name=None, b_or=None, b_i=0, nd=None)\n\n Generic class regrouping boundary conditions\n ",
22130 __pyx_tp_traverse_18BoundaryConditions_BC_Base,
22131 __pyx_tp_clear_18BoundaryConditions_BC_Base,
22136 __pyx_methods_18BoundaryConditions_BC_Base,
22138 __pyx_getsets_18BoundaryConditions_BC_Base,
22144 __pyx_pw_18BoundaryConditions_7BC_Base_1__init__,
22146 __pyx_tp_new_18BoundaryConditions_BC_Base,
22156 #if PY_VERSION_HEX >= 0x030400a1
22160 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
22162 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22163 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
22165 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22166 o = (*t->tp_alloc)(t, 0);
22168 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22170 if (unlikely(!o))
return 0;
22171 p = ((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
22172 p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
22173 p->uOfXT = Py_None; Py_INCREF(Py_None);
22177 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
22178 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
22179 #if CYTHON_USE_TP_FINALIZE
22180 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22181 if (PyObject_CallFinalizerFromDealloc(o))
return;
22184 PyObject_GC_UnTrack(o);
22185 Py_CLEAR(p->uOfXT);
22186 (*Py_TYPE(o)->tp_free)(o);
22189 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc
v,
void *a) {
22191 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
22193 e = (*v)(p->uOfXT, a);
if (e)
return e;
22198 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
22200 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
22201 tmp = ((PyObject*)p->uOfXT);
22202 p->uOfXT = Py_None; Py_INCREF(Py_None);
22207 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED
void *x) {
22208 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
22211 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
22213 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o,
v);
22216 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
22220 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
22221 {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython},
22222 {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
22223 {
"setLinearBC", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC},
22224 {
"setLinearRamp", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp},
22225 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__},
22226 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__},
22230 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
22231 {(
char *)
"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (
char *)
"uOfXT: object", 0},
22235 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
22236 PyVarObject_HEAD_INIT(0, 0)
22237 "BoundaryConditions.BoundaryCondition",
22238 sizeof(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition),
22240 __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition,
22244 #if PY_MAJOR_VERSION < 3
22247 #if PY_MAJOR_VERSION >= 3
22260 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22261 "BoundaryCondition()\n\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ",
22262 __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition,
22263 __pyx_tp_clear_18BoundaryConditions_BoundaryCondition,
22268 __pyx_methods_18BoundaryConditions_BoundaryCondition,
22270 __pyx_getsets_18BoundaryConditions_BoundaryCondition,
22276 __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__,
22278 __pyx_tp_new_18BoundaryConditions_BoundaryCondition,
22288 #if PY_VERSION_HEX >= 0x030400a1
22293 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
22294 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
22296 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22298 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
22299 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
22300 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
22301 (void) PyObject_INIT(o, t);
22302 PyObject_GC_Track(o);
22304 o = (*t->tp_alloc)(t, 0);
22305 if (unlikely(!o))
return 0;
22310 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
22311 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
22312 PyObject_GC_UnTrack(o);
22313 Py_CLEAR(p->__pyx_v_value);
22314 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
22315 __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
22317 (*Py_TYPE(o)->tp_free)(o);
22321 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc
v,
void *a) {
22323 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
22324 if (p->__pyx_v_value) {
22325 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
22330 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
22332 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
22333 tmp = ((PyObject*)p->__pyx_v_value);
22334 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
22339 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
22340 PyVarObject_HEAD_INIT(0, 0)
22341 "BoundaryConditions.__pyx_scope_struct__setConstantBC",
22342 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC),
22344 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC,
22348 #if PY_MAJOR_VERSION < 3
22351 #if PY_MAJOR_VERSION >= 3
22364 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
22366 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC,
22367 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC,
22382 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC,
22392 #if PY_VERSION_HEX >= 0x030400a1
22397 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
22398 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
22400 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22402 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
22403 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
22404 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
22405 (void) PyObject_INIT(o, t);
22406 PyObject_GC_Track(o);
22408 o = (*t->tp_alloc)(t, 0);
22409 if (unlikely(!o))
return 0;
22414 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
22415 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22416 PyObject_GC_UnTrack(o);
22417 Py_CLEAR(p->__pyx_v_a);
22418 Py_CLEAR(p->__pyx_v_a0);
22419 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
22420 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
22422 (*Py_TYPE(o)->tp_free)(o);
22426 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc
v,
void *a) {
22428 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22429 if (p->__pyx_v_a) {
22430 e = (*v)(p->__pyx_v_a, a);
if (e)
return e;
22432 if (p->__pyx_v_a0) {
22433 e = (*v)(p->__pyx_v_a0, a);
if (e)
return e;
22438 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
22440 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22441 tmp = ((PyObject*)p->__pyx_v_a);
22442 p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
22444 tmp = ((PyObject*)p->__pyx_v_a0);
22445 p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
22450 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
22451 PyVarObject_HEAD_INIT(0, 0)
22452 "BoundaryConditions.__pyx_scope_struct_1_setLinearBC",
22453 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC),
22455 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
22459 #if PY_MAJOR_VERSION < 3
22462 #if PY_MAJOR_VERSION >= 3
22475 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
22477 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
22478 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
22493 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
22503 #if PY_VERSION_HEX >= 0x030400a1
22508 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[8];
22509 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
22511 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22513 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
22514 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp];
22515 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp));
22516 (void) PyObject_INIT(o, t);
22517 PyObject_GC_Track(o);
22519 o = (*t->tp_alloc)(t, 0);
22520 if (unlikely(!o))
return 0;
22525 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
22526 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22527 PyObject_GC_UnTrack(o);
22528 Py_CLEAR(p->__pyx_v_t1);
22529 Py_CLEAR(p->__pyx_v_value);
22530 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
22531 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o);
22533 (*Py_TYPE(o)->tp_free)(o);
22537 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o, visitproc
v,
void *a) {
22539 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22540 if (p->__pyx_v_t1) {
22541 e = (*v)(p->__pyx_v_t1, a);
if (e)
return e;
22543 if (p->__pyx_v_value) {
22544 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
22549 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
22551 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22552 tmp = ((PyObject*)p->__pyx_v_t1);
22553 p->__pyx_v_t1 = Py_None; Py_INCREF(Py_None);
22555 tmp = ((PyObject*)p->__pyx_v_value);
22556 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
22561 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = {
22562 PyVarObject_HEAD_INIT(0, 0)
22563 "BoundaryConditions.__pyx_scope_struct_2_setLinearRamp",
22564 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp),
22566 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
22570 #if PY_MAJOR_VERSION < 3
22573 #if PY_MAJOR_VERSION >= 3
22586 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
22588 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
22589 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
22604 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
22614 #if PY_VERSION_HEX >= 0x030400a1
22618 static struct __pyx_vtabstruct_array __pyx_vtable_array;
22620 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22621 struct __pyx_array_obj *p;
22623 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22624 o = (*t->tp_alloc)(t, 0);
22626 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22628 if (unlikely(!o))
return 0;
22629 p = ((
struct __pyx_array_obj *)o);
22630 p->__pyx_vtab = __pyx_vtabptr_array;
22631 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22632 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22633 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
22636 Py_DECREF(o); o = 0;
22640 static void __pyx_tp_dealloc_array(PyObject *o) {
22641 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
22642 #if CYTHON_USE_TP_FINALIZE
22643 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22644 if (PyObject_CallFinalizerFromDealloc(o))
return;
22648 PyObject *etype, *eval, *etb;
22649 PyErr_Fetch(&etype, &eval, &etb);
22651 __pyx_array___dealloc__(o);
22653 PyErr_Restore(etype, eval, etb);
22656 Py_CLEAR(p->_format);
22657 (*Py_TYPE(o)->tp_free)(o);
22659 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
22661 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22662 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22667 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
22669 return __pyx_array___setitem__(o, i,
v);
22672 PyErr_Format(PyExc_NotImplementedError,
22673 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22678 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
22679 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
22680 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22682 v = __pyx_array___getattr__(o,
n);
22687 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
22688 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22691 static PyMethodDef __pyx_methods_array[] = {
22692 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22693 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22694 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22698 static struct PyGetSetDef __pyx_getsets_array[] = {
22699 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
22703 static PySequenceMethods __pyx_tp_as_sequence_array = {
22704 __pyx_array___len__,
22707 __pyx_sq_item_array,
22716 static PyMappingMethods __pyx_tp_as_mapping_array = {
22717 __pyx_array___len__,
22718 __pyx_array___getitem__,
22719 __pyx_mp_ass_subscript_array,
22722 static PyBufferProcs __pyx_tp_as_buffer_array = {
22723 #if PY_MAJOR_VERSION < 3
22726 #if PY_MAJOR_VERSION < 3
22729 #if PY_MAJOR_VERSION < 3
22732 #if PY_MAJOR_VERSION < 3
22735 __pyx_array_getbuffer,
22739 static PyTypeObject __pyx_type___pyx_array = {
22740 PyVarObject_HEAD_INIT(0, 0)
22741 "BoundaryConditions.array",
22742 sizeof(
struct __pyx_array_obj),
22744 __pyx_tp_dealloc_array,
22748 #if PY_MAJOR_VERSION < 3
22751 #if PY_MAJOR_VERSION >= 3
22756 &__pyx_tp_as_sequence_array,
22757 &__pyx_tp_as_mapping_array,
22761 __pyx_tp_getattro_array,
22763 &__pyx_tp_as_buffer_array,
22764 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
22772 __pyx_methods_array,
22774 __pyx_getsets_array,
22782 __pyx_tp_new_array,
22792 #if PY_VERSION_HEX >= 0x030400a1
22797 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22798 struct __pyx_MemviewEnum_obj *p;
22800 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22801 o = (*t->tp_alloc)(t, 0);
22803 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22805 if (unlikely(!o))
return 0;
22806 p = ((
struct __pyx_MemviewEnum_obj *)o);
22807 p->name = Py_None; Py_INCREF(Py_None);
22811 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22812 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22813 #if CYTHON_USE_TP_FINALIZE
22814 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22815 if (PyObject_CallFinalizerFromDealloc(o))
return;
22818 PyObject_GC_UnTrack(o);
22820 (*Py_TYPE(o)->tp_free)(o);
22823 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
22825 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22827 e = (*v)(p->name, a);
if (e)
return e;
22832 static int __pyx_tp_clear_Enum(PyObject *o) {
22834 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22835 tmp = ((PyObject*)p->name);
22836 p->name = Py_None; Py_INCREF(Py_None);
22841 static PyMethodDef __pyx_methods_Enum[] = {
22842 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22843 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22847 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22848 PyVarObject_HEAD_INIT(0, 0)
22849 "BoundaryConditions.Enum",
22850 sizeof(
struct __pyx_MemviewEnum_obj),
22852 __pyx_tp_dealloc_Enum,
22856 #if PY_MAJOR_VERSION < 3
22859 #if PY_MAJOR_VERSION >= 3
22862 __pyx_MemviewEnum___repr__,
22872 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22874 __pyx_tp_traverse_Enum,
22875 __pyx_tp_clear_Enum,
22880 __pyx_methods_Enum,
22888 __pyx_MemviewEnum___init__,
22900 #if PY_VERSION_HEX >= 0x030400a1
22904 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22906 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22907 struct __pyx_memoryview_obj *p;
22909 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22910 o = (*t->tp_alloc)(t, 0);
22912 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22914 if (unlikely(!o))
return 0;
22915 p = ((
struct __pyx_memoryview_obj *)o);
22916 p->__pyx_vtab = __pyx_vtabptr_memoryview;
22917 p->obj = Py_None; Py_INCREF(Py_None);
22918 p->_size = Py_None; Py_INCREF(Py_None);
22919 p->_array_interface = Py_None; Py_INCREF(Py_None);
22920 p->view.obj = NULL;
22921 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
22924 Py_DECREF(o); o = 0;
22928 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22929 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22930 #if CYTHON_USE_TP_FINALIZE
22931 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22932 if (PyObject_CallFinalizerFromDealloc(o))
return;
22935 PyObject_GC_UnTrack(o);
22937 PyObject *etype, *eval, *etb;
22938 PyErr_Fetch(&etype, &eval, &etb);
22940 __pyx_memoryview___dealloc__(o);
22942 PyErr_Restore(etype, eval, etb);
22945 Py_CLEAR(p->_size);
22946 Py_CLEAR(p->_array_interface);
22947 (*Py_TYPE(o)->tp_free)(o);
22950 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
22952 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22954 e = (*v)(p->obj, a);
if (e)
return e;
22957 e = (*v)(p->_size, a);
if (e)
return e;
22959 if (p->_array_interface) {
22960 e = (*v)(p->_array_interface, a);
if (e)
return e;
22963 e = (*v)(p->view.obj, a);
if (e)
return e;
22968 static int __pyx_tp_clear_memoryview(PyObject *o) {
22970 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22971 tmp = ((PyObject*)p->obj);
22972 p->obj = Py_None; Py_INCREF(Py_None);
22974 tmp = ((PyObject*)p->_size);
22975 p->_size = Py_None; Py_INCREF(Py_None);
22977 tmp = ((PyObject*)p->_array_interface);
22978 p->_array_interface = Py_None; Py_INCREF(Py_None);
22980 Py_CLEAR(p->view.obj);
22983 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22985 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22986 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22991 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
22993 return __pyx_memoryview___setitem__(o, i,
v);
22996 PyErr_Format(PyExc_NotImplementedError,
22997 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
23002 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
23003 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
23006 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
23007 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
23010 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
23011 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
23014 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
23015 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
23018 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
23019 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
23022 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
23023 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
23026 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
23027 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
23030 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
23031 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
23034 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
23035 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
23038 static PyMethodDef __pyx_methods_memoryview[] = {
23039 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
23040 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
23041 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
23042 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
23043 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
23044 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
23048 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
23049 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
23050 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
23051 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
23052 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
23053 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
23054 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
23055 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
23056 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
23057 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
23061 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
23062 __pyx_memoryview___len__,
23065 __pyx_sq_item_memoryview,
23074 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
23075 __pyx_memoryview___len__,
23076 __pyx_memoryview___getitem__,
23077 __pyx_mp_ass_subscript_memoryview,
23080 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
23081 #if PY_MAJOR_VERSION < 3
23084 #if PY_MAJOR_VERSION < 3
23087 #if PY_MAJOR_VERSION < 3
23090 #if PY_MAJOR_VERSION < 3
23093 __pyx_memoryview_getbuffer,
23097 static PyTypeObject __pyx_type___pyx_memoryview = {
23098 PyVarObject_HEAD_INIT(0, 0)
23099 "BoundaryConditions.memoryview",
23100 sizeof(
struct __pyx_memoryview_obj),
23102 __pyx_tp_dealloc_memoryview,
23106 #if PY_MAJOR_VERSION < 3
23109 #if PY_MAJOR_VERSION >= 3
23112 __pyx_memoryview___repr__,
23114 &__pyx_tp_as_sequence_memoryview,
23115 &__pyx_tp_as_mapping_memoryview,
23118 __pyx_memoryview___str__,
23121 &__pyx_tp_as_buffer_memoryview,
23122 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23124 __pyx_tp_traverse_memoryview,
23125 __pyx_tp_clear_memoryview,
23130 __pyx_methods_memoryview,
23132 __pyx_getsets_memoryview,
23140 __pyx_tp_new_memoryview,
23150 #if PY_VERSION_HEX >= 0x030400a1
23154 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
23156 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
23157 struct __pyx_memoryviewslice_obj *p;
23158 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
23159 if (unlikely(!o))
return 0;
23160 p = ((
struct __pyx_memoryviewslice_obj *)o);
23161 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
23162 p->from_object = Py_None; Py_INCREF(Py_None);
23163 p->from_slice.memview = NULL;
23167 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
23168 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
23169 #if CYTHON_USE_TP_FINALIZE
23170 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
23171 if (PyObject_CallFinalizerFromDealloc(o))
return;
23174 PyObject_GC_UnTrack(o);
23176 PyObject *etype, *eval, *etb;
23177 PyErr_Fetch(&etype, &eval, &etb);
23179 __pyx_memoryviewslice___dealloc__(o);
23181 PyErr_Restore(etype, eval, etb);
23183 Py_CLEAR(p->from_object);
23184 PyObject_GC_Track(o);
23185 __pyx_tp_dealloc_memoryview(o);
23188 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
23190 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
23191 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
23192 if (p->from_object) {
23193 e = (*v)(p->from_object, a);
if (e)
return e;
23198 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
23200 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
23201 __pyx_tp_clear_memoryview(o);
23202 tmp = ((PyObject*)p->from_object);
23203 p->from_object = Py_None; Py_INCREF(Py_None);
23205 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
23209 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
23210 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
23213 static PyMethodDef __pyx_methods__memoryviewslice[] = {
23214 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
23215 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
23219 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
23220 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
23224 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
23225 PyVarObject_HEAD_INIT(0, 0)
23226 "BoundaryConditions._memoryviewslice",
23227 sizeof(
struct __pyx_memoryviewslice_obj),
23229 __pyx_tp_dealloc__memoryviewslice,
23233 #if PY_MAJOR_VERSION < 3
23236 #if PY_MAJOR_VERSION >= 3
23239 #if CYTHON_COMPILING_IN_PYPY
23240 __pyx_memoryview___repr__,
23249 #if CYTHON_COMPILING_IN_PYPY
23250 __pyx_memoryview___str__,
23257 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23258 "Internal class for passing memoryview slices to Python",
23259 __pyx_tp_traverse__memoryviewslice,
23260 __pyx_tp_clear__memoryviewslice,
23265 __pyx_methods__memoryviewslice,
23267 __pyx_getsets__memoryviewslice,
23275 __pyx_tp_new__memoryviewslice,
23285 #if PY_VERSION_HEX >= 0x030400a1
23290 static PyMethodDef __pyx_methods[] = {
23294 #if PY_MAJOR_VERSION >= 3
23295 #if CYTHON_PEP489_MULTI_PHASE_INIT
23296 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
23297 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module);
23298 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
23299 {Py_mod_create, (
void*)__pyx_pymod_create},
23300 {Py_mod_exec, (
void*)__pyx_pymod_exec_BoundaryConditions},
23305 static struct PyModuleDef __pyx_moduledef = {
23306 PyModuleDef_HEAD_INIT,
23307 "BoundaryConditions",
23309 #if CYTHON_PEP489_MULTI_PHASE_INIT
23315 #if CYTHON_PEP489_MULTI_PHASE_INIT
23316 __pyx_moduledef_slots,
23325 #ifndef CYTHON_SMALL_CODE
23326 #if defined(__clang__)
23327 #define CYTHON_SMALL_CODE
23328 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
23329 #define CYTHON_SMALL_CODE __attribute__((cold))
23331 #define CYTHON_SMALL_CODE
23335 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23336 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
23337 {&__pyx_n_s_BC_Base, __pyx_k_BC_Base,
sizeof(__pyx_k_BC_Base), 0, 0, 1, 1},
23338 {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython,
sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
23339 {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython,
sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
23340 {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext,
sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
23341 {&__pyx_n_s_BoundaryCondition, __pyx_k_BoundaryCondition,
sizeof(__pyx_k_BoundaryCondition), 0, 0, 1, 1},
23342 {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho,
sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
23343 {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt,
sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
23344 {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython,
sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
23345 {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC,
sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
23346 {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC,
sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
23347 {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC,
sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
23348 {&__pyx_n_s_BoundaryCondition_setLinearRamp, __pyx_k_BoundaryCondition_setLinearRamp,
sizeof(__pyx_k_BoundaryCondition_setLinearRamp), 0, 0, 1, 1},
23349 {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions,
sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
23350 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
23351 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
23352 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
23353 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
23354 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
23355 {&__pyx_n_s_Context, __pyx_k_Context,
sizeof(__pyx_k_Context), 0, 0, 1, 1},
23356 {&__pyx_n_s_Domain, __pyx_k_Domain,
sizeof(__pyx_k_Domain), 0, 0, 1, 1},
23357 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
23358 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
23359 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23360 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23361 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23362 {&__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_k_Incompatible_checksums_s_vs_0x96,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0x96), 0, 0, 1, 0},
23363 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
23364 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
23365 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
23366 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
23367 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
23368 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
23369 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
23370 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
23371 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23372 {&__pyx_n_s_None, __pyx_k_None,
sizeof(__pyx_k_None), 0, 0, 1, 1},
23373 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
23374 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
23375 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
23376 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23377 {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC,
sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
23378 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
23379 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
23380 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23381 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
23382 {&__pyx_n_s_a, __pyx_k_a,
sizeof(__pyx_k_a), 0, 0, 1, 1},
23383 {&__pyx_n_s_a0, __pyx_k_a0,
sizeof(__pyx_k_a0), 0, 0, 1, 1},
23384 {&__pyx_n_s_all, __pyx_k_all,
sizeof(__pyx_k_all), 0, 0, 1, 1},
23385 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
23386 {&__pyx_n_s_b_i, __pyx_k_b_i,
sizeof(__pyx_k_b_i), 0, 0, 1, 1},
23387 {&__pyx_n_s_b_or, __pyx_k_b_or,
sizeof(__pyx_k_b_or), 0, 0, 1, 1},
23388 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
23389 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
23390 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
23391 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
23392 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
23393 {&__pyx_n_s_context, __pyx_k_context,
sizeof(__pyx_k_context), 0, 0, 1, 1},
23394 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
23395 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
23396 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
23397 {&__pyx_n_s_dict_2, __pyx_k_dict_2,
sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
23398 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
23399 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
23400 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
23401 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
23402 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
23403 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
23404 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
23405 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
23406 {&__pyx_n_s_get, __pyx_k_get,
sizeof(__pyx_k_get), 0, 0, 1, 1},
23407 {&__pyx_n_s_getContext, __pyx_k_getContext,
sizeof(__pyx_k_getContext), 0, 0, 1, 1},
23408 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
23409 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
23410 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
23411 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
23412 {&__pyx_n_s_init_cython, __pyx_k_init_cython,
sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
23413 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
23414 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
23415 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
23416 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
23417 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
23418 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
23419 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
23420 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
23421 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
23422 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
23423 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
23424 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
23425 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
23426 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
23427 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
23428 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23429 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23430 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23431 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
23432 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
23433 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
23434 {&__pyx_n_s_proteus, __pyx_k_proteus,
sizeof(__pyx_k_proteus), 0, 0, 1, 1},
23435 {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py,
sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
23436 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
23437 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
23438 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
23439 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
23440 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
23441 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
23442 {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base,
sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
23443 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
23444 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
23445 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
23446 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
23447 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
23448 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
23449 {&__pyx_n_s_resetBC, __pyx_k_resetBC,
sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
23450 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
23451 {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted,
sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
23452 {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC,
sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
23453 {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda,
sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
23454 {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC,
sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
23455 {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda,
sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
23456 {&__pyx_n_s_setLinearRamp, __pyx_k_setLinearRamp,
sizeof(__pyx_k_setLinearRamp), 0, 0, 1, 1},
23457 {&__pyx_n_s_setLinearRamp_locals_lambda, __pyx_k_setLinearRamp_locals_lambda,
sizeof(__pyx_k_setLinearRamp_locals_lambda), 0, 0, 1, 1},
23458 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
23459 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
23460 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
23461 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
23462 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
23463 {&__pyx_n_s_state, __pyx_k_state,
sizeof(__pyx_k_state), 0, 0, 1, 1},
23464 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
23465 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
23466 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
23467 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
23468 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
23469 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
23470 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
23471 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
23472 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
23473 {&__pyx_n_s_t1, __pyx_k_t1,
sizeof(__pyx_k_t1), 0, 0, 1, 1},
23474 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
23475 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
23476 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
23477 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23478 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
23479 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
23480 {&__pyx_n_s_use_setstate, __pyx_k_use_setstate,
sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
23481 {&__pyx_n_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 1},
23482 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
23483 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
23484 {0, 0, 0, 0, 0, 0, 0}
23486 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
23487 __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum);
if (!__pyx_builtin_sum) __PYX_ERR(0, 113, __pyx_L1_error)
23488 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
23489 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(3, 272, __pyx_L1_error)
23490 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(3, 285, __pyx_L1_error)
23491 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 856, __pyx_L1_error)
23492 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1038, __pyx_L1_error)
23493 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
23494 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
23495 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 400, __pyx_L1_error)
23496 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 609, __pyx_L1_error)
23497 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 828, __pyx_L1_error)
23503 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
23504 __Pyx_RefNannyDeclarations
23505 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
23514 __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 113, __pyx_L1_error)
23515 __Pyx_GOTREF(__pyx_slice__7);
23516 __Pyx_GIVEREF(__pyx_slice__7);
23524 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
23525 __Pyx_GOTREF(__pyx_tuple__11);
23526 __Pyx_GIVEREF(__pyx_tuple__11);
23533 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
23534 __Pyx_GOTREF(__pyx_tuple__13);
23535 __Pyx_GIVEREF(__pyx_tuple__13);
23544 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 272, __pyx_L1_error)
23545 __Pyx_GOTREF(__pyx_tuple__15);
23546 __Pyx_GIVEREF(__pyx_tuple__15);
23555 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 276, __pyx_L1_error)
23556 __Pyx_GOTREF(__pyx_tuple__16);
23557 __Pyx_GIVEREF(__pyx_tuple__16);
23566 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 306, __pyx_L1_error)
23567 __Pyx_GOTREF(__pyx_tuple__17);
23568 __Pyx_GIVEREF(__pyx_tuple__17);
23577 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 856, __pyx_L1_error)
23578 __Pyx_GOTREF(__pyx_tuple__18);
23579 __Pyx_GIVEREF(__pyx_tuple__18);
23588 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 880, __pyx_L1_error)
23589 __Pyx_GOTREF(__pyx_tuple__19);
23590 __Pyx_GIVEREF(__pyx_tuple__19);
23599 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 1038, __pyx_L1_error)
23600 __Pyx_GOTREF(__pyx_tuple__20);
23601 __Pyx_GIVEREF(__pyx_tuple__20);
23610 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 1044, __pyx_L1_error)
23611 __Pyx_GOTREF(__pyx_tuple__21);
23612 __Pyx_GIVEREF(__pyx_tuple__21);
23621 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 133, __pyx_L1_error)
23622 __Pyx_GOTREF(__pyx_tuple__22);
23623 __Pyx_GIVEREF(__pyx_tuple__22);
23632 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 136, __pyx_L1_error)
23633 __Pyx_GOTREF(__pyx_tuple__23);
23634 __Pyx_GIVEREF(__pyx_tuple__23);
23643 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 148, __pyx_L1_error)
23644 __Pyx_GOTREF(__pyx_tuple__24);
23645 __Pyx_GIVEREF(__pyx_tuple__24);
23654 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 176, __pyx_L1_error)
23655 __Pyx_GOTREF(__pyx_tuple__25);
23656 __Pyx_GIVEREF(__pyx_tuple__25);
23665 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 192, __pyx_L1_error)
23666 __Pyx_GOTREF(__pyx_tuple__26);
23667 __Pyx_GIVEREF(__pyx_tuple__26);
23675 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
23676 __Pyx_GOTREF(__pyx_tuple__27);
23677 __Pyx_GIVEREF(__pyx_tuple__27);
23684 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
23685 __Pyx_GOTREF(__pyx_tuple__28);
23686 __Pyx_GIVEREF(__pyx_tuple__28);
23695 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 414, __pyx_L1_error)
23696 __Pyx_GOTREF(__pyx_tuple__29);
23697 __Pyx_GIVEREF(__pyx_tuple__29);
23706 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 491, __pyx_L1_error)
23707 __Pyx_GOTREF(__pyx_tuple__30);
23708 __Pyx_GIVEREF(__pyx_tuple__30);
23717 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 516, __pyx_L1_error)
23718 __Pyx_GOTREF(__pyx_tuple__31);
23719 __Pyx_GIVEREF(__pyx_tuple__31);
23728 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 566, __pyx_L1_error)
23729 __Pyx_GOTREF(__pyx_tuple__32);
23730 __Pyx_GIVEREF(__pyx_tuple__32);
23739 __pyx_tuple__33 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 573, __pyx_L1_error)
23740 __Pyx_GOTREF(__pyx_tuple__33);
23741 __Pyx_INCREF(__pyx_int_neg_1);
23742 __Pyx_GIVEREF(__pyx_int_neg_1);
23743 PyTuple_SET_ITEM(__pyx_tuple__33, 0, __pyx_int_neg_1);
23744 __Pyx_GIVEREF(__pyx_tuple__33);
23752 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
23753 __Pyx_GOTREF(__pyx_tuple__34);
23754 __Pyx_GIVEREF(__pyx_tuple__34);
23761 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
23762 __Pyx_GOTREF(__pyx_tuple__35);
23763 __Pyx_GIVEREF(__pyx_tuple__35);
23772 __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 699, __pyx_L1_error)
23773 __Pyx_GOTREF(__pyx_tuple__36);
23774 __Pyx_GIVEREF(__pyx_tuple__36);
23782 __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 2, __pyx_L1_error)
23783 __Pyx_GOTREF(__pyx_tuple__37);
23784 __Pyx_GIVEREF(__pyx_tuple__37);
23791 __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 4, __pyx_L1_error)
23792 __Pyx_GOTREF(__pyx_tuple__38);
23793 __Pyx_GIVEREF(__pyx_tuple__38);
23802 __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 52, __pyx_L1_error)
23803 __Pyx_GOTREF(__pyx_tuple__40);
23804 __Pyx_GIVEREF(__pyx_tuple__40);
23805 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 52, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 52, __pyx_L1_error)
23812 __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 1, __pyx_L1_error)
23813 __Pyx_GOTREF(__pyx_tuple__41);
23814 __Pyx_GIVEREF(__pyx_tuple__41);
23815 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 1, __pyx_L1_error)
23823 __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 16, __pyx_L1_error)
23824 __Pyx_GOTREF(__pyx_tuple__42);
23825 __Pyx_GIVEREF(__pyx_tuple__42);
23826 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 16, __pyx_L1_error)
23835 __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 81, __pyx_L1_error)
23836 __Pyx_GOTREF(__pyx_tuple__43);
23837 __Pyx_GIVEREF(__pyx_tuple__43);
23838 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 81, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 81, __pyx_L1_error)
23847 __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 84, __pyx_L1_error)
23848 __Pyx_GOTREF(__pyx_tuple__44);
23849 __Pyx_GIVEREF(__pyx_tuple__44);
23850 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 84, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 84, __pyx_L1_error)
23859 __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 87, __pyx_L1_error)
23860 __Pyx_GOTREF(__pyx_tuple__45);
23861 __Pyx_GIVEREF(__pyx_tuple__45);
23862 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 87, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 87, __pyx_L1_error)
23871 __pyx_tuple__46 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 100, __pyx_L1_error)
23872 __Pyx_GOTREF(__pyx_tuple__46);
23873 __Pyx_GIVEREF(__pyx_tuple__46);
23874 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 100, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 100, __pyx_L1_error)
23883 __pyx_tuple__47 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t1, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 115, __pyx_L1_error)
23884 __Pyx_GOTREF(__pyx_tuple__47);
23885 __Pyx_GIVEREF(__pyx_tuple__47);
23886 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearRamp, 115, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 115, __pyx_L1_error)
23893 __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 1, __pyx_L1_error)
23894 __Pyx_GOTREF(__pyx_tuple__48);
23895 __Pyx_GIVEREF(__pyx_tuple__48);
23896 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error)
23904 __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 3, __pyx_L1_error)
23905 __Pyx_GOTREF(__pyx_tuple__49);
23906 __Pyx_GIVEREF(__pyx_tuple__49);
23907 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 3, __pyx_L1_error)
23914 __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 1, __pyx_L1_error)
23915 __Pyx_GOTREF(__pyx_tuple__50);
23916 __Pyx_GIVEREF(__pyx_tuple__50);
23917 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
23926 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 286, __pyx_L1_error)
23927 __Pyx_GOTREF(__pyx_tuple__51);
23928 __Pyx_GIVEREF(__pyx_tuple__51);
23937 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 287, __pyx_L1_error)
23938 __Pyx_GOTREF(__pyx_tuple__52);
23939 __Pyx_GIVEREF(__pyx_tuple__52);
23948 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 288, __pyx_L1_error)
23949 __Pyx_GOTREF(__pyx_tuple__53);
23950 __Pyx_GIVEREF(__pyx_tuple__53);
23959 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 291, __pyx_L1_error)
23960 __Pyx_GOTREF(__pyx_tuple__54);
23961 __Pyx_GIVEREF(__pyx_tuple__54);
23970 __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 292, __pyx_L1_error)
23971 __Pyx_GOTREF(__pyx_tuple__55);
23972 __Pyx_GIVEREF(__pyx_tuple__55);
23979 __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 1, __pyx_L1_error)
23980 __Pyx_GOTREF(__pyx_tuple__56);
23981 __Pyx_GIVEREF(__pyx_tuple__56);
23982 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 1, __pyx_L1_error)
23983 __Pyx_RefNannyFinishContext();
23986 __Pyx_RefNannyFinishContext();
23990 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
23991 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23992 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23993 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23994 __pyx_int_3 = PyInt_FromLong(3);
if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
23995 __pyx_int_158231071 = PyInt_FromLong(158231071
L);
if (unlikely(!__pyx_int_158231071)) __PYX_ERR(0, 1, __pyx_L1_error)
23996 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23997 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24003 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
24004 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
24005 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
24006 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
24007 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
24008 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
24009 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
24011 static int __Pyx_modinit_global_init_code(
void) {
24012 __Pyx_RefNannyDeclarations
24013 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
24015 generic = Py_None; Py_INCREF(Py_None);
24016 strided = Py_None; Py_INCREF(Py_None);
24017 indirect = Py_None; Py_INCREF(Py_None);
24018 contiguous = Py_None; Py_INCREF(Py_None);
24019 indirect_contiguous = Py_None; Py_INCREF(Py_None);
24020 __Pyx_RefNannyFinishContext();
24024 static int __Pyx_modinit_variable_export_code(
void) {
24025 __Pyx_RefNannyDeclarations
24026 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
24028 __Pyx_RefNannyFinishContext();
24032 static int __Pyx_modinit_function_export_code(
void) {
24033 __Pyx_RefNannyDeclarations
24034 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
24036 __Pyx_RefNannyFinishContext();
24040 static int __Pyx_modinit_type_init_code(
void) {
24041 __Pyx_RefNannyDeclarations
24042 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
24044 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
24045 __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
24046 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
24047 __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
24049 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BC_Base, (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
24050 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
24051 __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
24052 __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
24053 __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
24054 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
24055 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
24056 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
24057 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
24059 if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
24060 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoundaryCondition, (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
24061 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
24062 __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
24063 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
24064 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
24065 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
24066 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
24068 __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
24069 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
24070 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
24071 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
24072 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
24074 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
24075 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
24076 __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_print = 0;
24077 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro == PyObject_GenericGetAttr)) {
24078 __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
24080 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = &__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
24081 __pyx_vtabptr_array = &__pyx_vtable_array;
24082 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
24083 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
24084 __pyx_type___pyx_array.tp_print = 0;
24085 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
24086 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
24087 __pyx_array_type = &__pyx_type___pyx_array;
24088 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
24089 __pyx_type___pyx_MemviewEnum.tp_print = 0;
24090 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
24091 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
24093 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
24094 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
24095 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
24096 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
24097 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
24098 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
24099 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
24100 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
24101 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
24102 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
24103 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
24104 __pyx_type___pyx_memoryview.tp_print = 0;
24105 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
24106 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
24108 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
24109 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
24110 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
24111 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
24112 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
24113 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
24114 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
24115 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
24116 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
24117 __pyx_type___pyx_memoryviewslice.tp_print = 0;
24118 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
24119 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
24121 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
24122 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
24123 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
24124 __Pyx_RefNannyFinishContext();
24127 __Pyx_RefNannyFinishContext();
24131 static int __Pyx_modinit_type_import_code(
void) {
24132 __Pyx_RefNannyDeclarations
24133 PyObject *__pyx_t_1 = NULL;
24134 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
24136 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
24137 __Pyx_GOTREF(__pyx_t_1);
24138 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
24139 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24140 sizeof(PyTypeObject),
24142 sizeof(PyHeapTypeObject),
24144 __Pyx_ImportType_CheckSize_Warn);
24145 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
24146 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24147 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 206, __pyx_L1_error)
24148 __Pyx_GOTREF(__pyx_t_1);
24149 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
24150 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 206, __pyx_L1_error)
24151 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
24152 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 229, __pyx_L1_error)
24153 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
24154 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 233, __pyx_L1_error)
24155 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
24156 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 242, __pyx_L1_error)
24157 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
24158 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 918, __pyx_L1_error)
24159 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24160 __Pyx_RefNannyFinishContext();
24163 __Pyx_XDECREF(__pyx_t_1);
24164 __Pyx_RefNannyFinishContext();
24168 static int __Pyx_modinit_variable_import_code(
void) {
24169 __Pyx_RefNannyDeclarations
24170 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
24172 __Pyx_RefNannyFinishContext();
24176 static int __Pyx_modinit_function_import_code(
void) {
24177 __Pyx_RefNannyDeclarations
24178 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
24180 __Pyx_RefNannyFinishContext();
24185 #if PY_MAJOR_VERSION < 3
24186 #ifdef CYTHON_NO_PYINIT_EXPORT
24187 #define __Pyx_PyMODINIT_FUNC void
24189 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
24192 #ifdef CYTHON_NO_PYINIT_EXPORT
24193 #define __Pyx_PyMODINIT_FUNC PyObject *
24195 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
24200 #if PY_MAJOR_VERSION < 3
24201 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void) CYTHON_SMALL_CODE;
24202 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void)
24204 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void) CYTHON_SMALL_CODE;
24205 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void)
24206 #if CYTHON_PEP489_MULTI_PHASE_INIT
24208 return PyModuleDef_Init(&__pyx_moduledef);
24210 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
24211 #if PY_VERSION_HEX >= 0x030700A1
24212 static PY_INT64_T main_interpreter_id = -1;
24213 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
24214 if (main_interpreter_id == -1) {
24215 main_interpreter_id = current_id;
24216 return (unlikely(current_id == -1)) ? -1 : 0;
24217 }
else if (unlikely(main_interpreter_id != current_id))
24219 static PyInterpreterState *main_interpreter = NULL;
24220 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
24221 if (!main_interpreter) {
24222 main_interpreter = current_interpreter;
24223 }
else if (unlikely(main_interpreter != current_interpreter))
24228 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
24233 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
24234 PyObject *value = PyObject_GetAttrString(spec, from_name);
24236 if (likely(value)) {
24237 if (allow_none || value != Py_None) {
24238 result = PyDict_SetItemString(moddict, to_name, value);
24241 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
24248 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
24249 PyObject *module = NULL, *moddict, *modname;
24250 if (__Pyx_check_single_interpreter())
24253 return __Pyx_NewRef(__pyx_m);
24254 modname = PyObject_GetAttrString(spec,
"name");
24255 if (unlikely(!modname))
goto bad;
24256 module = PyModule_NewObject(modname);
24257 Py_DECREF(modname);
24258 if (unlikely(!module))
goto bad;
24259 moddict = PyModule_GetDict(module);
24260 if (unlikely(!moddict))
goto bad;
24261 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
24262 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
24263 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
24264 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
24267 Py_XDECREF(module);
24272 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
24276 __Pyx_TraceDeclarations
24277 PyObject *__pyx_t_1 = NULL;
24278 static PyThread_type_lock __pyx_t_2[8];
24279 __Pyx_RefNannyDeclarations
24280 #if CYTHON_PEP489_MULTI_PHASE_INIT
24282 if (__pyx_m == __pyx_pyinit_module)
return 0;
24283 PyErr_SetString(PyExc_RuntimeError,
"Module 'BoundaryConditions' has already been imported. Re-initialisation is not supported.");
24286 #elif PY_MAJOR_VERSION >= 3
24287 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
24289 #if CYTHON_REFNANNY
24290 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
24291 if (!__Pyx_RefNanny) {
24293 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
24294 if (!__Pyx_RefNanny)
24295 Py_FatalError(
"failed to import 'refnanny' module");
24298 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
24299 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24300 #ifdef __Pxy_PyFrame_Initialize_Offsets
24301 __Pxy_PyFrame_Initialize_Offsets();
24303 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24304 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24305 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24306 #ifdef __Pyx_CyFunction_USED
24307 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24309 #ifdef __Pyx_FusedFunction_USED
24310 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24312 #ifdef __Pyx_Coroutine_USED
24313 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24315 #ifdef __Pyx_Generator_USED
24316 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24318 #ifdef __Pyx_AsyncGen_USED
24319 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24321 #ifdef __Pyx_StopAsyncIteration_USED
24322 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24326 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
24328 PyEval_InitThreads();
24332 #if CYTHON_PEP489_MULTI_PHASE_INIT
24333 __pyx_m = __pyx_pyinit_module;
24334 Py_INCREF(__pyx_m);
24336 #if PY_MAJOR_VERSION < 3
24337 __pyx_m = Py_InitModule4(
"BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24339 __pyx_m = PyModule_Create(&__pyx_moduledef);
24341 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
24343 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24344 Py_INCREF(__pyx_d);
24345 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24346 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24347 #if CYTHON_COMPILING_IN_PYPY
24348 Py_INCREF(__pyx_b);
24350 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24352 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24353 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
24354 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24356 if (__pyx_module_is_main_BoundaryConditions) {
24357 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24359 #if PY_MAJOR_VERSION >= 3
24361 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24362 if (!PyDict_GetItemString(modules,
"BoundaryConditions")) {
24363 if (unlikely(PyDict_SetItemString(modules,
"BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24368 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24370 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24372 (void)__Pyx_modinit_global_init_code();
24373 (void)__Pyx_modinit_variable_export_code();
24374 (void)__Pyx_modinit_function_export_code();
24375 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
24376 if (unlikely(__Pyx_modinit_type_import_code() != 0))
goto __pyx_L1_error;
24377 (void)__Pyx_modinit_variable_import_code();
24378 (void)__Pyx_modinit_function_import_code();
24380 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24381 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24383 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
24392 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
24393 __Pyx_GOTREF(__pyx_t_1);
24394 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
24395 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24404 __pyx_t_1 = PyList_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
24405 __Pyx_GOTREF(__pyx_t_1);
24406 __Pyx_INCREF(__pyx_n_s_BC_Base);
24407 __Pyx_GIVEREF(__pyx_n_s_BC_Base);
24408 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BC_Base);
24409 __Pyx_INCREF(__pyx_n_s_BoundaryCondition);
24410 __Pyx_GIVEREF(__pyx_n_s_BoundaryCondition);
24411 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundaryCondition);
24412 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
24413 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24422 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj_));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
24423 __Pyx_GOTREF(__pyx_t_1);
24424 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
24425 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24426 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
24433 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__2));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24434 __Pyx_GOTREF(__pyx_t_1);
24435 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24436 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24444 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__3));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
24445 __Pyx_GOTREF(__pyx_t_1);
24446 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
24447 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24456 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__4));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
24457 __Pyx_GOTREF(__pyx_t_1);
24458 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
24459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24460 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24469 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__5));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
24470 __Pyx_GOTREF(__pyx_t_1);
24471 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
24472 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24473 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24482 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__6));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
24483 __Pyx_GOTREF(__pyx_t_1);
24484 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
24485 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24486 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24495 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__8));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
24496 __Pyx_GOTREF(__pyx_t_1);
24497 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
24498 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24499 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24508 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearRamp, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__9));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
24509 __Pyx_GOTREF(__pyx_t_1);
24510 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearRamp, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
24511 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24512 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24519 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24520 __Pyx_GOTREF(__pyx_t_1);
24521 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24522 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24530 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__12));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
24531 __Pyx_GOTREF(__pyx_t_1);
24532 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
24533 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24540 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24541 __Pyx_GOTREF(__pyx_t_1);
24542 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24543 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24550 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24551 __Pyx_GOTREF(__pyx_t_1);
24552 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24562 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
24563 __Pyx_GOTREF(__pyx_t_1);
24564 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
24565 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24566 PyType_Modified(__pyx_array_type);
24575 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
24576 __Pyx_GOTREF(__pyx_t_1);
24577 __Pyx_XGOTREF(
generic);
24578 __Pyx_DECREF_SET(
generic, __pyx_t_1);
24579 __Pyx_GIVEREF(__pyx_t_1);
24589 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
24590 __Pyx_GOTREF(__pyx_t_1);
24591 __Pyx_XGOTREF(strided);
24592 __Pyx_DECREF_SET(strided, __pyx_t_1);
24593 __Pyx_GIVEREF(__pyx_t_1);
24603 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
24604 __Pyx_GOTREF(__pyx_t_1);
24605 __Pyx_XGOTREF(indirect);
24606 __Pyx_DECREF_SET(indirect, __pyx_t_1);
24607 __Pyx_GIVEREF(__pyx_t_1);
24617 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
24618 __Pyx_GOTREF(__pyx_t_1);
24619 __Pyx_XGOTREF(contiguous);
24620 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
24621 __Pyx_GIVEREF(__pyx_t_1);
24631 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
24632 __Pyx_GOTREF(__pyx_t_1);
24633 __Pyx_XGOTREF(indirect_contiguous);
24634 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
24635 __Pyx_GIVEREF(__pyx_t_1);
24645 __pyx_memoryview_thread_locks_used = 0;
24654 __pyx_t_2[0] = PyThread_allocate_lock();
24655 __pyx_t_2[1] = PyThread_allocate_lock();
24656 __pyx_t_2[2] = PyThread_allocate_lock();
24657 __pyx_t_2[3] = PyThread_allocate_lock();
24658 __pyx_t_2[4] = PyThread_allocate_lock();
24659 __pyx_t_2[5] = PyThread_allocate_lock();
24660 __pyx_t_2[6] = PyThread_allocate_lock();
24661 __pyx_t_2[7] = PyThread_allocate_lock();
24662 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24671 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L1_error)
24672 __Pyx_GOTREF(__pyx_t_1);
24673 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 545, __pyx_L1_error)
24674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24675 PyType_Modified(__pyx_memoryview_type);
24684 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 991, __pyx_L1_error)
24685 __Pyx_GOTREF(__pyx_t_1);
24686 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 991, __pyx_L1_error)
24687 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24688 PyType_Modified(__pyx_memoryviewslice_type);
24695 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24696 __Pyx_GOTREF(__pyx_t_1);
24697 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24698 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24707 __Pyx_TraceReturn(Py_None, 0);
24713 __Pyx_XDECREF(__pyx_t_1);
24716 __Pyx_AddTraceback(
"init BoundaryConditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
24719 }
else if (!PyErr_Occurred()) {
24720 PyErr_SetString(PyExc_ImportError,
"init BoundaryConditions");
24723 __Pyx_RefNannyFinishContext();
24724 #if CYTHON_PEP489_MULTI_PHASE_INIT
24725 return (__pyx_m != NULL) ? 0 : -1;
24726 #elif PY_MAJOR_VERSION >= 3
24735 #if CYTHON_REFNANNY
24736 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
24737 PyObject *m = NULL, *p = NULL;
24739 m = PyImport_ImportModule(modname);
24741 p = PyObject_GetAttrString(m,
"RefNannyAPI");
24743 r = PyLong_AsVoidPtr(p);
24747 return (__Pyx_RefNannyAPIStruct *)
r;
24752 #if CYTHON_USE_TYPE_SLOTS
24753 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24754 PyTypeObject* tp = Py_TYPE(obj);
24755 if (likely(tp->tp_getattro))
24756 return tp->tp_getattro(obj, attr_name);
24757 #if PY_MAJOR_VERSION < 3
24758 if (likely(tp->tp_getattr))
24759 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24761 return PyObject_GetAttr(obj, attr_name);
24766 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24767 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24768 if (unlikely(!result)) {
24769 PyErr_Format(PyExc_NameError,
24770 #
if PY_MAJOR_VERSION >= 3
24771 "name '%U' is not defined", name);
24773 "name '%.200s' is not defined", PyString_AS_STRING(name));
24780 static void __Pyx_RaiseDoubleKeywordsError(
24781 const char* func_name,
24784 PyErr_Format(PyExc_TypeError,
24785 #
if PY_MAJOR_VERSION >= 3
24786 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24788 "%s() got multiple values for keyword argument '%s'", func_name,
24789 PyString_AsString(kw_name));
24794 static int __Pyx_ParseOptionalKeywords(
24796 PyObject **argnames[],
24798 PyObject *values[],
24799 Py_ssize_t num_pos_args,
24800 const char* function_name)
24802 PyObject *key = 0, *value = 0;
24803 Py_ssize_t
pos = 0;
24805 PyObject*** first_kw_arg = argnames + num_pos_args;
24806 while (PyDict_Next(kwds, &
pos, &key, &value)) {
24807 name = first_kw_arg;
24808 while (*name && (**name != key)) name++;
24810 values[name-argnames] = value;
24813 name = first_kw_arg;
24814 #if PY_MAJOR_VERSION < 3
24815 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
24817 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24818 && _PyString_Eq(**name, key)) {
24819 values[name-argnames] = value;
24824 if (*name)
continue;
24826 PyObject*** argname = argnames;
24827 while (argname != first_kw_arg) {
24828 if ((**argname == key) || (
24829 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24830 && _PyString_Eq(**argname, key))) {
24831 goto arg_passed_twice;
24838 if (likely(PyUnicode_Check(key))) {
24840 int cmp = (**name == key) ? 0 :
24841 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24842 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
24844 PyUnicode_Compare(**name, key);
24845 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24847 values[name-argnames] = value;
24852 if (*name)
continue;
24854 PyObject*** argname = argnames;
24855 while (argname != first_kw_arg) {
24856 int cmp = (**argname == key) ? 0 :
24857 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24858 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
24860 PyUnicode_Compare(**argname, key);
24861 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24862 if (cmp == 0)
goto arg_passed_twice;
24867 goto invalid_keyword_type;
24869 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24871 goto invalid_keyword;
24876 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24878 invalid_keyword_type:
24879 PyErr_Format(PyExc_TypeError,
24880 "%.200s() keywords must be strings", function_name);
24883 PyErr_Format(PyExc_TypeError,
24884 #
if PY_MAJOR_VERSION < 3
24885 "%.200s() got an unexpected keyword argument '%.200s'",
24886 function_name, PyString_AsString(key));
24888 "%s() got an unexpected keyword argument '%U'",
24889 function_name, key);
24896 static void __Pyx_RaiseArgtupleInvalid(
24897 const char* func_name,
24899 Py_ssize_t num_min,
24900 Py_ssize_t num_max,
24901 Py_ssize_t num_found)
24903 Py_ssize_t num_expected;
24904 const char *more_or_less;
24905 if (num_found < num_min) {
24906 num_expected = num_min;
24907 more_or_less =
"at least";
24909 num_expected = num_max;
24910 more_or_less =
"at most";
24913 more_or_less =
"exactly";
24915 PyErr_Format(PyExc_TypeError,
24916 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24917 func_name, more_or_less, num_expected,
24918 (num_expected == 1) ?
"" :
"s", num_found);
24922 #if CYTHON_FAST_THREAD_STATE
24923 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24924 PyObject *tmp_type, *tmp_value, *tmp_tb;
24925 tmp_type = tstate->curexc_type;
24926 tmp_value = tstate->curexc_value;
24927 tmp_tb = tstate->curexc_traceback;
24928 tstate->curexc_type = type;
24929 tstate->curexc_value = value;
24930 tstate->curexc_traceback = tb;
24931 Py_XDECREF(tmp_type);
24932 Py_XDECREF(tmp_value);
24933 Py_XDECREF(tmp_tb);
24935 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24936 *type = tstate->curexc_type;
24937 *value = tstate->curexc_value;
24938 *tb = tstate->curexc_traceback;
24939 tstate->curexc_type = 0;
24940 tstate->curexc_value = 0;
24941 tstate->curexc_traceback = 0;
24947 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24948 PyFrameObject** frame,
24949 PyThreadState* tstate,
24950 const char *funcname,
24951 const char *srcfile,
24953 PyObject *type, *value, *traceback;
24955 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24956 if (*code == NULL) {
24957 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24958 if (*code == NULL)
return 0;
24960 *frame = PyFrame_New(
24966 if (*frame == NULL)
return 0;
24967 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24968 Py_INCREF(Py_None);
24969 (*frame)->f_trace = Py_None;
24971 #if PY_VERSION_HEX < 0x030400B1
24973 (*frame)->f_tstate = tstate;
24976 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24979 tstate->use_tracing = 0;
24980 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24982 if (tstate->c_tracefunc)
24983 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24984 if (retval && tstate->c_profilefunc)
24986 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24987 tstate->use_tracing = (tstate->c_profilefunc ||
24988 (CYTHON_TRACE && tstate->c_tracefunc));
24991 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24992 return tstate->use_tracing && retval;
24996 Py_XDECREF(traceback);
25000 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
25001 PyObject *py_srcfile = 0;
25002 PyObject *py_funcname = 0;
25003 PyCodeObject *py_code = 0;
25004 #if PY_MAJOR_VERSION < 3
25005 py_funcname = PyString_FromString(funcname);
25006 py_srcfile = PyString_FromString(srcfile);
25008 py_funcname = PyUnicode_FromString(funcname);
25009 py_srcfile = PyUnicode_FromString(srcfile);
25011 if (!py_funcname | !py_srcfile)
goto bad;
25012 py_code = PyCode_New(
25014 #
if PY_MAJOR_VERSION >= 3
25019 CO_OPTIMIZED | CO_NEWLOCALS,
25032 Py_XDECREF(py_srcfile);
25033 Py_XDECREF(py_funcname);
25039 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25041 if (!j)
return NULL;
25042 r = PyObject_GetItem(o, j);
25046 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25047 CYTHON_NCP_UNUSED
int wraparound,
25048 CYTHON_NCP_UNUSED
int boundscheck) {
25049 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25050 Py_ssize_t wrapped_i = i;
25051 if (wraparound & unlikely(i < 0)) {
25052 wrapped_i += PyList_GET_SIZE(o);
25054 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25055 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
25059 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25061 return PySequence_GetItem(o, i);
25064 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25065 CYTHON_NCP_UNUSED
int wraparound,
25066 CYTHON_NCP_UNUSED
int boundscheck) {
25067 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25068 Py_ssize_t wrapped_i = i;
25069 if (wraparound & unlikely(i < 0)) {
25070 wrapped_i += PyTuple_GET_SIZE(o);
25072 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25073 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
25077 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25079 return PySequence_GetItem(o, i);
25082 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
25083 CYTHON_NCP_UNUSED
int wraparound,
25084 CYTHON_NCP_UNUSED
int boundscheck) {
25085 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25086 if (is_list || PyList_CheckExact(o)) {
25087 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25088 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
25089 PyObject *
r = PyList_GET_ITEM(o,
n);
25094 else if (PyTuple_CheckExact(o)) {
25095 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25096 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
25097 PyObject *
r = PyTuple_GET_ITEM(o,
n);
25102 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25103 if (likely(m && m->sq_item)) {
25104 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25105 Py_ssize_t l = m->sq_length(o);
25106 if (likely(l >= 0)) {
25109 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25114 return m->sq_item(o, i);
25118 if (is_list || PySequence_Check(o)) {
25119 return PySequence_GetItem(o, i);
25122 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25126 #if CYTHON_USE_TYPE_SLOTS
25127 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25129 Py_ssize_t key_value;
25130 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25131 if (unlikely(!(m && m->sq_item))) {
25132 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25135 key_value = __Pyx_PyIndex_AsSsize_t(index);
25136 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25137 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25139 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25141 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25145 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25146 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25147 if (likely(m && m->mp_subscript)) {
25148 return m->mp_subscript(obj, key);
25150 return __Pyx_PyObject_GetIndex(obj, key);
25156 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
25158 __Pyx_memviewslice *memviewslice,
25159 int memview_is_new_reference)
25161 __Pyx_RefNannyDeclarations
25163 Py_buffer *buf = &memview->view;
25164 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
25166 PyErr_SetString(PyExc_ValueError,
25169 }
else if (memviewslice->memview || memviewslice->data) {
25170 PyErr_SetString(PyExc_ValueError,
25171 "memviewslice is already initialized!");
25174 if (buf->strides) {
25175 for (i = 0; i < ndim; i++) {
25176 memviewslice->strides[i] = buf->strides[i];
25179 Py_ssize_t stride = buf->itemsize;
25180 for (i = ndim - 1; i >= 0; i--) {
25181 memviewslice->strides[i] = stride;
25182 stride *= buf->shape[i];
25185 for (i = 0; i < ndim; i++) {
25186 memviewslice->shape[i] = buf->shape[i];
25187 if (buf->suboffsets) {
25188 memviewslice->suboffsets[i] = buf->suboffsets[i];
25190 memviewslice->suboffsets[i] = -1;
25193 memviewslice->memview = memview;
25194 memviewslice->data = (
char *)buf->buf;
25195 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
25196 Py_INCREF(memview);
25201 memviewslice->memview = 0;
25202 memviewslice->data = 0;
25205 __Pyx_RefNannyFinishContext();
25208 #ifndef Py_NO_RETURN
25209 #define Py_NO_RETURN
25211 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
25214 #ifdef HAVE_STDARG_PROTOTYPES
25215 va_start(vargs, fmt);
25219 vsnprintf(msg, 200, fmt, vargs);
25221 Py_FatalError(msg);
25223 static CYTHON_INLINE
int
25224 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25225 PyThread_type_lock lock)
25228 PyThread_acquire_lock(lock, 1);
25229 result = (*acquisition_count)++;
25230 PyThread_release_lock(lock);
25233 static CYTHON_INLINE
int
25234 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25235 PyThread_type_lock lock)
25238 PyThread_acquire_lock(lock, 1);
25239 result = (*acquisition_count)--;
25240 PyThread_release_lock(lock);
25243 static CYTHON_INLINE
void
25244 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
25247 struct __pyx_memoryview_obj *memview = memslice->memview;
25248 if (!memview || (PyObject *) memview == Py_None)
25250 if (__pyx_get_slice_count(memview) < 0)
25251 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
25252 __pyx_get_slice_count(memview), lineno);
25253 first_time = __pyx_add_acquisition_count(memview) == 0;
25256 Py_INCREF((PyObject *) memview);
25258 PyGILState_STATE _gilstate = PyGILState_Ensure();
25259 Py_INCREF((PyObject *) memview);
25260 PyGILState_Release(_gilstate);
25264 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25265 int have_gil,
int lineno) {
25267 struct __pyx_memoryview_obj *memview = memslice->memview;
25270 }
else if ((PyObject *) memview == Py_None) {
25271 memslice->memview = NULL;
25274 if (__pyx_get_slice_count(memview) <= 0)
25275 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
25276 __pyx_get_slice_count(memview), lineno);
25277 last_time = __pyx_sub_acquisition_count(memview) == 1;
25278 memslice->data = NULL;
25281 Py_CLEAR(memslice->memview);
25283 PyGILState_STATE _gilstate = PyGILState_Ensure();
25284 Py_CLEAR(memslice->memview);
25285 PyGILState_Release(_gilstate);
25288 memslice->memview = NULL;
25293 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25294 PyObject *empty_list = 0;
25295 PyObject *module = 0;
25296 PyObject *global_dict = 0;
25297 PyObject *empty_dict = 0;
25299 #if PY_MAJOR_VERSION < 3
25300 PyObject *py_import;
25301 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25308 empty_list = PyList_New(0);
25313 global_dict = PyModule_GetDict(__pyx_m);
25316 empty_dict = PyDict_New();
25320 #if PY_MAJOR_VERSION >= 3
25322 if (strchr(__Pyx_MODULE_NAME,
'.')) {
25323 module = PyImport_ImportModuleLevelObject(
25324 name, global_dict, empty_dict, list, 1);
25326 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25335 #if PY_MAJOR_VERSION < 3
25336 PyObject *py_level = PyInt_FromLong(level);
25339 module = PyObject_CallFunctionObjArgs(py_import,
25340 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25341 Py_DECREF(py_level);
25343 module = PyImport_ImportModuleLevelObject(
25344 name, global_dict, empty_dict, list, level);
25349 #if PY_MAJOR_VERSION < 3
25350 Py_XDECREF(py_import);
25352 Py_XDECREF(empty_list);
25353 Py_XDECREF(empty_dict);
25358 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25359 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25360 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25361 PyErr_Format(PyExc_ImportError,
25362 #
if PY_MAJOR_VERSION < 3
25363 "cannot import name %.230s", PyString_AS_STRING(name));
25365 "cannot import name %S", name);
25372 #if CYTHON_FAST_PYCALL
25373 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
25374 PyObject *globals) {
25376 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25377 PyObject **fastlocals;
25380 assert(globals != NULL);
25385 assert(tstate != NULL);
25386 f = PyFrame_New(tstate, co, globals, NULL);
25390 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
25391 for (i = 0; i < na; i++) {
25393 fastlocals[i] = *args++;
25395 result = PyEval_EvalFrameEx(
f,0);
25396 ++tstate->recursion_depth;
25398 --tstate->recursion_depth;
25401 #if 1 || PY_VERSION_HEX < 0x030600B1
25402 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
25403 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
25404 PyObject *globals = PyFunction_GET_GLOBALS(func);
25405 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
25407 #if PY_MAJOR_VERSION >= 3
25410 PyObject *kwtuple, **k;
25415 assert(kwargs == NULL || PyDict_Check(kwargs));
25416 nk = kwargs ? PyDict_Size(kwargs) : 0;
25417 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
25421 #
if PY_MAJOR_VERSION >= 3
25422 co->co_kwonlyargcount == 0 &&
25424 likely(kwargs == NULL || nk == 0) &&
25425 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
25426 if (argdefs == NULL && co->co_argcount == nargs) {
25427 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
25430 else if (nargs == 0 && argdefs != NULL
25431 && co->co_argcount == Py_SIZE(argdefs)) {
25434 args = &PyTuple_GET_ITEM(argdefs, 0);
25435 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
25439 if (kwargs != NULL) {
25441 kwtuple = PyTuple_New(2 * nk);
25442 if (kwtuple == NULL) {
25446 k = &PyTuple_GET_ITEM(kwtuple, 0);
25448 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
25459 closure = PyFunction_GET_CLOSURE(func);
25460 #if PY_MAJOR_VERSION >= 3
25461 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
25463 if (argdefs != NULL) {
25464 d = &PyTuple_GET_ITEM(argdefs, 0);
25465 nd = Py_SIZE(argdefs);
25471 #if PY_MAJOR_VERSION >= 3
25472 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
25475 d, (
int)nd, kwdefs, closure);
25477 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
25480 d, (
int)nd, closure);
25482 Py_XDECREF(kwtuple);
25484 Py_LeaveRecursiveCall();
25491 #if CYTHON_COMPILING_IN_CPYTHON
25492 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25494 ternaryfunc call = func->ob_type->tp_call;
25495 if (unlikely(!call))
25496 return PyObject_Call(func, arg, kw);
25497 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
25499 result = (*call)(func, arg, kw);
25500 Py_LeaveRecursiveCall();
25501 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25504 "NULL result without error in PyObject_Call");
25511 #if CYTHON_COMPILING_IN_CPYTHON
25512 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
25513 PyObject *
self, *result;
25515 cfunc = PyCFunction_GET_FUNCTION(func);
25516 self = PyCFunction_GET_SELF(func);
25517 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
25519 result = cfunc(
self, arg);
25520 Py_LeaveRecursiveCall();
25521 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25524 "NULL result without error in PyObject_Call");
25531 #if CYTHON_COMPILING_IN_CPYTHON
25532 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
25533 #if CYTHON_FAST_PYCALL
25534 if (PyFunction_Check(func)) {
25535 return __Pyx_PyFunction_FastCall(func, NULL, 0);
25538 #ifdef __Pyx_CyFunction_USED
25539 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
25541 if (likely(PyCFunction_Check(func)))
25544 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
25545 return __Pyx_PyObject_CallMethO(func, NULL);
25548 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
25553 #if CYTHON_FAST_PYCCALL
25554 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
25555 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
25556 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
25557 PyObject *
self = PyCFunction_GET_SELF(func);
25558 int flags = PyCFunction_GET_FLAGS(func);
25559 assert(PyCFunction_Check(func));
25560 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
25561 assert(nargs >= 0);
25562 assert(nargs == 0 || args != NULL);
25566 assert(!PyErr_Occurred());
25567 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
25568 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
25570 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
25576 #if CYTHON_COMPILING_IN_CPYTHON
25577 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25579 PyObject *args = PyTuple_New(1);
25580 if (unlikely(!args))
return NULL;
25582 PyTuple_SET_ITEM(args, 0, arg);
25583 result = __Pyx_PyObject_Call(func, args, NULL);
25587 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25588 #if CYTHON_FAST_PYCALL
25589 if (PyFunction_Check(func)) {
25590 return __Pyx_PyFunction_FastCall(func, &arg, 1);
25593 if (likely(PyCFunction_Check(func))) {
25594 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
25595 return __Pyx_PyObject_CallMethO(func, arg);
25596 #if CYTHON_FAST_PYCCALL
25597 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
25598 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
25602 return __Pyx__PyObject_CallOneArg(func, arg);
25605 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25607 PyObject *args = PyTuple_Pack(1, arg);
25608 if (unlikely(!args))
return NULL;
25609 result = __Pyx_PyObject_Call(func, args, NULL);
25616 #if CYTHON_FAST_THREAD_STATE
25617 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25619 n = PyTuple_GET_SIZE(tuple);
25620 #if PY_MAJOR_VERSION >= 3
25621 for (i=0; i<
n; i++) {
25622 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25625 for (i=0; i<
n; i++) {
25626 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
25630 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25631 PyObject *exc_type = tstate->curexc_type;
25632 if (exc_type == err)
return 1;
25633 if (unlikely(!exc_type))
return 0;
25634 if (unlikely(PyTuple_Check(err)))
25635 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25636 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25641 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
25642 #if CYTHON_USE_TYPE_SLOTS
25643 #if PY_MAJOR_VERSION >= 3
25644 if (likely(PyUnicode_Check(
n)))
25646 if (likely(PyString_Check(
n)))
25648 return __Pyx_PyObject_GetAttrStr(o,
n);
25650 return PyObject_GetAttr(o,
n);
25654 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25655 __Pyx_PyThreadState_declare
25656 __Pyx_PyThreadState_assign
25657 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25659 __Pyx_PyErr_Clear();
25663 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
25664 PyObject *
r = __Pyx_GetAttr(o,
n);
25665 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
25669 #if CYTHON_USE_DICT_VERSIONS
25670 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25672 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25676 #if !CYTHON_AVOID_BORROWED_REFS
25677 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25678 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25679 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25680 if (likely(result)) {
25681 return __Pyx_NewRef(result);
25682 }
else if (unlikely(PyErr_Occurred())) {
25686 result = PyDict_GetItem(__pyx_d, name);
25687 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25688 if (likely(result)) {
25689 return __Pyx_NewRef(result);
25693 result = PyObject_GetItem(__pyx_d, name);
25694 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25695 if (likely(result)) {
25696 return __Pyx_NewRef(result);
25700 return __Pyx_GetBuiltinName(name);
25704 static int __Pyx_CheckKeywordStrings(
25706 const char* function_name,
25710 Py_ssize_t
pos = 0;
25711 #if CYTHON_COMPILING_IN_PYPY
25712 if (!kw_allowed && PyDict_Next(kwdict, &
pos, &key, 0))
25713 goto invalid_keyword;
25716 while (PyDict_Next(kwdict, &
pos, &key, 0)) {
25717 #if PY_MAJOR_VERSION < 3
25718 if (unlikely(!PyString_Check(key)))
25720 if (unlikely(!PyUnicode_Check(key)))
25721 goto invalid_keyword_type;
25723 if ((!kw_allowed) && unlikely(key))
25724 goto invalid_keyword;
25726 invalid_keyword_type:
25727 PyErr_Format(PyExc_TypeError,
25728 "%.200s() keywords must be strings", function_name);
25732 PyErr_Format(PyExc_TypeError,
25733 #
if PY_MAJOR_VERSION < 3
25734 "%.200s() got an unexpected keyword argument '%.200s'",
25735 function_name, PyString_AsString(key));
25737 "%s() got an unexpected keyword argument '%U'",
25738 function_name, key);
25744 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
25745 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
25746 int full_traceback, CYTHON_UNUSED
int nogil) {
25747 PyObject *old_exc, *old_val, *old_tb;
25749 __Pyx_PyThreadState_declare
25751 PyGILState_STATE state;
25753 state = PyGILState_Ensure();
25755 else state = (PyGILState_STATE)-1;
25758 __Pyx_PyThreadState_assign
25759 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25760 if (full_traceback) {
25761 Py_XINCREF(old_exc);
25762 Py_XINCREF(old_val);
25763 Py_XINCREF(old_tb);
25764 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25767 #if PY_MAJOR_VERSION < 3
25768 ctx = PyString_FromString(name);
25770 ctx = PyUnicode_FromString(name);
25772 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25774 PyErr_WriteUnraisable(Py_None);
25776 PyErr_WriteUnraisable(ctx);
25781 PyGILState_Release(state);
25786 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname) {
25787 PyErr_Format(PyExc_NameError,
"free variable '%s' referenced before assignment in enclosing scope", varname);
25791 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25792 PyObject* fake_module;
25793 PyTypeObject* cached_type = NULL;
25794 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
25795 if (!fake_module)
return NULL;
25796 Py_INCREF(fake_module);
25797 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25799 if (!PyType_Check((PyObject*)cached_type)) {
25800 PyErr_Format(PyExc_TypeError,
25801 "Shared Cython type %.200s is not a type object",
25805 if (cached_type->tp_basicsize != type->tp_basicsize) {
25806 PyErr_Format(PyExc_TypeError,
25807 "Shared Cython type %.200s has the wrong size, try recompiling",
25812 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
25814 if (PyType_Ready(type) < 0)
goto bad;
25815 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25818 cached_type = type;
25821 Py_DECREF(fake_module);
25822 return cached_type;
25824 Py_XDECREF(cached_type);
25825 cached_type = NULL;
25830 #include <structmember.h>
25832 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
25834 if (unlikely(op->func_doc == NULL)) {
25835 if (op->func.m_ml->ml_doc) {
25836 #if PY_MAJOR_VERSION >= 3
25837 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25839 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25841 if (unlikely(op->func_doc == NULL))
25844 Py_INCREF(Py_None);
25848 Py_INCREF(op->func_doc);
25849 return op->func_doc;
25852 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25854 PyObject *tmp = op->func_doc;
25855 if (value == NULL) {
25859 op->func_doc = value;
25864 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25866 if (unlikely(op->func_name == NULL)) {
25867 #if PY_MAJOR_VERSION >= 3
25868 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25870 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25872 if (unlikely(op->func_name == NULL))
25875 Py_INCREF(op->func_name);
25876 return op->func_name;
25879 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25882 #if PY_MAJOR_VERSION >= 3
25883 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25885 if (unlikely(value == NULL || !PyString_Check(value)))
25888 PyErr_SetString(PyExc_TypeError,
25889 "__name__ must be set to a string object");
25892 tmp = op->func_name;
25894 op->func_name = value;
25899 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25901 Py_INCREF(op->func_qualname);
25902 return op->func_qualname;
25905 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25908 #if PY_MAJOR_VERSION >= 3
25909 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25911 if (unlikely(value == NULL || !PyString_Check(value)))
25914 PyErr_SetString(PyExc_TypeError,
25915 "__qualname__ must be set to a string object");
25918 tmp = op->func_qualname;
25920 op->func_qualname = value;
25925 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
25928 self = m->func_closure;
25935 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25937 if (unlikely(op->func_dict == NULL)) {
25938 op->func_dict = PyDict_New();
25939 if (unlikely(op->func_dict == NULL))
25942 Py_INCREF(op->func_dict);
25943 return op->func_dict;
25946 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25949 if (unlikely(value == NULL)) {
25950 PyErr_SetString(PyExc_TypeError,
25951 "function's dictionary may not be deleted");
25954 if (unlikely(!PyDict_Check(value))) {
25955 PyErr_SetString(PyExc_TypeError,
25956 "setting function's dictionary to a non-dict");
25959 tmp = op->func_dict;
25961 op->func_dict = value;
25966 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25968 Py_INCREF(op->func_globals);
25969 return op->func_globals;
25972 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25974 Py_INCREF(Py_None);
25978 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25980 PyObject* result = (op->func_code) ? op->func_code : Py_None;
25985 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25987 PyObject *res = op->defaults_getter((PyObject *) op);
25988 if (unlikely(!res))
25990 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25991 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25992 Py_INCREF(op->defaults_tuple);
25993 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25994 Py_INCREF(op->defaults_kwdict);
25996 op->defaults_tuple = PySequence_ITEM(res, 0);
25997 if (unlikely(!op->defaults_tuple)) result = -1;
25999 op->defaults_kwdict = PySequence_ITEM(res, 1);
26000 if (unlikely(!op->defaults_kwdict)) result = -1;
26007 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26011 }
else if (value != Py_None && !PyTuple_Check(value)) {
26012 PyErr_SetString(PyExc_TypeError,
26013 "__defaults__ must be set to a tuple object");
26017 tmp = op->defaults_tuple;
26018 op->defaults_tuple = value;
26023 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26024 PyObject* result = op->defaults_tuple;
26025 if (unlikely(!result)) {
26026 if (op->defaults_getter) {
26027 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26028 result = op->defaults_tuple;
26037 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26041 }
else if (value != Py_None && !PyDict_Check(value)) {
26042 PyErr_SetString(PyExc_TypeError,
26043 "__kwdefaults__ must be set to a dict object");
26047 tmp = op->defaults_kwdict;
26048 op->defaults_kwdict = value;
26053 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26054 PyObject* result = op->defaults_kwdict;
26055 if (unlikely(!result)) {
26056 if (op->defaults_getter) {
26057 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26058 result = op->defaults_kwdict;
26067 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26069 if (!value || value == Py_None) {
26071 }
else if (!PyDict_Check(value)) {
26072 PyErr_SetString(PyExc_TypeError,
26073 "__annotations__ must be set to a dict object");
26077 tmp = op->func_annotations;
26078 op->func_annotations = value;
26083 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26084 PyObject* result = op->func_annotations;
26085 if (unlikely(!result)) {
26086 result = PyDict_New();
26087 if (unlikely(!result))
return NULL;
26088 op->func_annotations = result;
26093 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26094 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26095 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26096 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26097 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26098 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26099 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26100 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26101 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26102 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26103 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26104 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26105 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26106 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26107 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26108 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26109 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26110 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26111 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26114 static PyMemberDef __pyx_CyFunction_members[] = {
26115 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26119 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26121 #if PY_MAJOR_VERSION >= 3
26122 return PyUnicode_FromString(m->func.m_ml->ml_name);
26124 return PyString_FromString(m->func.m_ml->ml_name);
26127 static PyMethodDef __pyx_CyFunction_methods[] = {
26128 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26131 #if PY_VERSION_HEX < 0x030500A0
26132 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26134 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26136 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml,
int flags, PyObject* qualname,
26137 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26138 __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
26142 __Pyx_CyFunction_weakreflist(op) = NULL;
26143 op->func.m_ml = ml;
26144 op->func.m_self = (PyObject *) op;
26145 Py_XINCREF(closure);
26146 op->func_closure = closure;
26147 Py_XINCREF(module);
26148 op->func.m_module = module;
26149 op->func_dict = NULL;
26150 op->func_name = NULL;
26151 Py_INCREF(qualname);
26152 op->func_qualname = qualname;
26153 op->func_doc = NULL;
26154 op->func_classobj = NULL;
26155 op->func_globals = globals;
26156 Py_INCREF(op->func_globals);
26158 op->func_code = code;
26159 op->defaults_pyobjects = 0;
26160 op->defaults = NULL;
26161 op->defaults_tuple = NULL;
26162 op->defaults_kwdict = NULL;
26163 op->defaults_getter = NULL;
26164 op->func_annotations = NULL;
26165 PyObject_GC_Track(op);
26166 return (PyObject *) op;
26169 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26171 Py_CLEAR(m->func_closure);
26172 Py_CLEAR(m->func.m_module);
26173 Py_CLEAR(m->func_dict);
26174 Py_CLEAR(m->func_name);
26175 Py_CLEAR(m->func_qualname);
26176 Py_CLEAR(m->func_doc);
26177 Py_CLEAR(m->func_globals);
26178 Py_CLEAR(m->func_code);
26179 Py_CLEAR(m->func_classobj);
26180 Py_CLEAR(m->defaults_tuple);
26181 Py_CLEAR(m->defaults_kwdict);
26182 Py_CLEAR(m->func_annotations);
26184 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26186 for (i = 0; i < m->defaults_pyobjects; i++)
26187 Py_XDECREF(pydefaults[i]);
26188 PyObject_Free(m->defaults);
26189 m->defaults = NULL;
26193 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26195 if (__Pyx_CyFunction_weakreflist(m) != NULL)
26196 PyObject_ClearWeakRefs((PyObject *) m);
26197 __Pyx_CyFunction_clear(m);
26198 PyObject_GC_Del(m);
26200 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26202 PyObject_GC_UnTrack(m);
26203 __Pyx__CyFunction_dealloc(m);
26205 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
26207 Py_VISIT(m->func_closure);
26208 Py_VISIT(m->func.m_module);
26209 Py_VISIT(m->func_dict);
26210 Py_VISIT(m->func_name);
26211 Py_VISIT(m->func_qualname);
26212 Py_VISIT(m->func_doc);
26213 Py_VISIT(m->func_globals);
26214 Py_VISIT(m->func_code);
26215 Py_VISIT(m->func_classobj);
26216 Py_VISIT(m->defaults_tuple);
26217 Py_VISIT(m->defaults_kwdict);
26219 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26221 for (i = 0; i < m->defaults_pyobjects; i++)
26222 Py_VISIT(pydefaults[i]);
26226 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26228 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26229 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26233 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26235 type = (PyObject *)(Py_TYPE(obj));
26236 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26238 if (obj == Py_None)
26240 return __Pyx_PyMethod_New(func, obj, type);
26243 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26245 #if PY_MAJOR_VERSION >= 3
26246 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
26247 op->func_qualname, (
void *)op);
26249 return PyString_FromFormat(
"<cyfunction %s at %p>",
26250 PyString_AsString(op->func_qualname), (
void *)op);
26253 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
26254 PyCFunctionObject*
f = (PyCFunctionObject*)func;
26255 PyCFunction meth =
f->m_ml->ml_meth;
26257 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26259 if (likely(kw == NULL || PyDict_Size(kw) == 0))
26260 return (*meth)(
self, arg);
26262 case METH_VARARGS | METH_KEYWORDS:
26263 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
26265 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26266 size = PyTuple_GET_SIZE(arg);
26267 if (likely(size == 0))
26268 return (*meth)(
self, NULL);
26269 PyErr_Format(PyExc_TypeError,
26270 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26271 f->m_ml->ml_name, size);
26276 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26277 size = PyTuple_GET_SIZE(arg);
26278 if (likely(size == 1)) {
26279 PyObject *result, *arg0;
26280 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26281 arg0 = PyTuple_GET_ITEM(arg, 0);
26283 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
26285 result = (*meth)(
self, arg0);
26286 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26291 PyErr_Format(PyExc_TypeError,
26292 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26293 f->m_ml->ml_name, size);
26298 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
26299 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26300 "longer supported!");
26303 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
26307 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26308 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26310 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26312 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26313 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26315 PyObject *new_args;
26317 argc = PyTuple_GET_SIZE(args);
26318 new_args = PyTuple_GetSlice(args, 1, argc);
26319 if (unlikely(!new_args))
26321 self = PyTuple_GetItem(args, 0);
26322 if (unlikely(!
self)) {
26323 Py_DECREF(new_args);
26326 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
26327 Py_DECREF(new_args);
26329 result = __Pyx_CyFunction_Call(func, args, kw);
26333 static PyTypeObject __pyx_CyFunctionType_type = {
26334 PyVarObject_HEAD_INIT(0, 0)
26335 "cython_function_or_method",
26336 sizeof(__pyx_CyFunctionObject),
26338 (destructor) __Pyx_CyFunction_dealloc,
26342 #if PY_MAJOR_VERSION < 3
26347 (reprfunc) __Pyx_CyFunction_repr,
26352 __Pyx_CyFunction_CallAsMethod,
26357 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26359 (traverseproc) __Pyx_CyFunction_traverse,
26360 (inquiry) __Pyx_CyFunction_clear,
26362 #
if PY_VERSION_HEX < 0x030500A0
26363 offsetof(__pyx_CyFunctionObject, func_weakreflist),
26365 offsetof(PyCFunctionObject, m_weakreflist),
26369 __pyx_CyFunction_methods,
26370 __pyx_CyFunction_members,
26371 __pyx_CyFunction_getsets,
26374 __Pyx_CyFunction_descr_get,
26376 offsetof(__pyx_CyFunctionObject, func_dict),
26389 #if PY_VERSION_HEX >= 0x030400a1
26393 static int __pyx_CyFunction_init(
void) {
26394 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26395 if (unlikely(__pyx_CyFunctionType == NULL)) {
26400 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
26401 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26402 m->defaults = PyObject_Malloc(size);
26403 if (unlikely(!m->defaults))
26404 return PyErr_NoMemory();
26405 memset(m->defaults, 0, size);
26406 m->defaults_pyobjects = pyobjects;
26407 return m->defaults;
26409 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26410 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26411 m->defaults_tuple = tuple;
26414 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26415 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26416 m->defaults_kwdict = dict;
26419 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26420 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26421 m->func_annotations = dict;
26426 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
26427 PyObject *args, *result = NULL;
26428 #if CYTHON_FAST_PYCALL
26429 if (PyFunction_Check(
function)) {
26430 PyObject *args[2] = {arg1, arg2};
26431 return __Pyx_PyFunction_FastCall(
function, args, 2);
26434 #if CYTHON_FAST_PYCCALL
26435 if (__Pyx_PyFastCFunction_Check(
function)) {
26436 PyObject *args[2] = {arg1, arg2};
26437 return __Pyx_PyCFunction_FastCall(
function, args, 2);
26440 args = PyTuple_New(2);
26441 if (unlikely(!args))
goto done;
26443 PyTuple_SET_ITEM(args, 0, arg1);
26445 PyTuple_SET_ITEM(args, 1, arg2);
26446 Py_INCREF(
function);
26447 result = __Pyx_PyObject_Call(
function, args, NULL);
26449 Py_DECREF(
function);
26455 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
26456 Py_ssize_t cstart, Py_ssize_t cstop,
26457 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
26458 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
26459 #if CYTHON_USE_TYPE_SLOTS
26460 PyMappingMethods* mp;
26461 #if PY_MAJOR_VERSION < 3
26462 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
26463 if (likely(ms && ms->sq_slice)) {
26465 if (_py_start && (*_py_start != Py_None)) {
26466 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
26467 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
26472 if (_py_stop && (*_py_stop != Py_None)) {
26473 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
26474 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
26476 cstop = PY_SSIZE_T_MAX;
26478 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
26479 Py_ssize_t l = ms->sq_length(obj);
26480 if (likely(l >= 0)) {
26483 if (cstop < 0) cstop = 0;
26487 if (cstart < 0) cstart = 0;
26490 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
26495 return ms->sq_slice(obj, cstart, cstop);
26498 mp = Py_TYPE(obj)->tp_as_mapping;
26499 if (likely(mp && mp->mp_subscript))
26503 PyObject *py_slice, *py_start, *py_stop;
26505 py_slice = *_py_slice;
26507 PyObject* owned_start = NULL;
26508 PyObject* owned_stop = NULL;
26510 py_start = *_py_start;
26513 owned_start = py_start = PyInt_FromSsize_t(cstart);
26514 if (unlikely(!py_start))
goto bad;
26516 py_start = Py_None;
26519 py_stop = *_py_stop;
26522 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
26523 if (unlikely(!py_stop)) {
26524 Py_XDECREF(owned_start);
26530 py_slice = PySlice_New(py_start, py_stop, Py_None);
26531 Py_XDECREF(owned_start);
26532 Py_XDECREF(owned_stop);
26533 if (unlikely(!py_slice))
goto bad;
26535 #if CYTHON_USE_TYPE_SLOTS
26536 result = mp->mp_subscript(obj, py_slice);
26538 result = PyObject_GetItem(obj, py_slice);
26541 Py_DECREF(py_slice);
26545 PyErr_Format(PyExc_TypeError,
26546 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
26552 #if PY_MAJOR_VERSION < 3
26553 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
26554 CYTHON_UNUSED PyObject *cause) {
26555 __Pyx_PyThreadState_declare
26557 if (!value || value == Py_None)
26561 if (!tb || tb == Py_None)
26565 if (!PyTraceBack_Check(tb)) {
26566 PyErr_SetString(PyExc_TypeError,
26567 "raise: arg 3 must be a traceback or None");
26571 if (PyType_Check(type)) {
26572 #if CYTHON_COMPILING_IN_PYPY
26574 Py_INCREF(Py_None);
26578 PyErr_NormalizeException(&type, &value, &tb);
26581 PyErr_SetString(PyExc_TypeError,
26582 "instance exception may not have a separate value");
26586 type = (PyObject*) Py_TYPE(type);
26588 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
26589 PyErr_SetString(PyExc_TypeError,
26590 "raise: exception class must be a subclass of BaseException");
26594 __Pyx_PyThreadState_assign
26595 __Pyx_ErrRestore(type, value, tb);
26604 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
26605 PyObject* owned_instance = NULL;
26606 if (tb == Py_None) {
26608 }
else if (tb && !PyTraceBack_Check(tb)) {
26609 PyErr_SetString(PyExc_TypeError,
26610 "raise: arg 3 must be a traceback or None");
26613 if (value == Py_None)
26615 if (PyExceptionInstance_Check(type)) {
26617 PyErr_SetString(PyExc_TypeError,
26618 "instance exception may not have a separate value");
26622 type = (PyObject*) Py_TYPE(value);
26623 }
else if (PyExceptionClass_Check(type)) {
26624 PyObject *instance_class = NULL;
26625 if (value && PyExceptionInstance_Check(value)) {
26626 instance_class = (PyObject*) Py_TYPE(value);
26627 if (instance_class != type) {
26628 int is_subclass = PyObject_IsSubclass(instance_class, type);
26629 if (!is_subclass) {
26630 instance_class = NULL;
26631 }
else if (unlikely(is_subclass == -1)) {
26634 type = instance_class;
26638 if (!instance_class) {
26641 args = PyTuple_New(0);
26642 else if (PyTuple_Check(value)) {
26646 args = PyTuple_Pack(1, value);
26649 owned_instance = PyObject_Call(type, args, NULL);
26651 if (!owned_instance)
26653 value = owned_instance;
26654 if (!PyExceptionInstance_Check(value)) {
26655 PyErr_Format(PyExc_TypeError,
26656 "calling %R should have returned an instance of "
26657 "BaseException, not %R",
26658 type, Py_TYPE(value));
26663 PyErr_SetString(PyExc_TypeError,
26664 "raise: exception class must be a subclass of BaseException");
26668 PyObject *fixed_cause;
26669 if (cause == Py_None) {
26670 fixed_cause = NULL;
26671 }
else if (PyExceptionClass_Check(cause)) {
26672 fixed_cause = PyObject_CallObject(cause, NULL);
26673 if (fixed_cause == NULL)
26675 }
else if (PyExceptionInstance_Check(cause)) {
26676 fixed_cause = cause;
26677 Py_INCREF(fixed_cause);
26679 PyErr_SetString(PyExc_TypeError,
26680 "exception causes must derive from "
26684 PyException_SetCause(value, fixed_cause);
26686 PyErr_SetObject(type, value);
26688 #if CYTHON_COMPILING_IN_PYPY
26689 PyObject *tmp_type, *tmp_value, *tmp_tb;
26690 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
26692 PyErr_Restore(tmp_type, tmp_value, tb);
26693 Py_XDECREF(tmp_tb);
26695 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26696 PyObject* tmp_tb = tstate->curexc_traceback;
26697 if (tb != tmp_tb) {
26699 tstate->curexc_traceback = tb;
26700 Py_XDECREF(tmp_tb);
26705 Py_XDECREF(owned_instance);
26711 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
26713 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
26714 PyErr_SetString(PyExc_TypeError,
26715 "hasattr(): attribute name must be string");
26718 r = __Pyx_GetAttr(o,
n);
26719 if (unlikely(!
r)) {
26729 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
26730 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
26732 value = PyDict_GetItemWithError(d, key);
26733 if (unlikely(!value)) {
26734 if (!PyErr_Occurred()) {
26735 if (unlikely(PyTuple_Check(key))) {
26736 PyObject* args = PyTuple_Pack(1, key);
26737 if (likely(args)) {
26738 PyErr_SetObject(PyExc_KeyError, args);
26742 PyErr_SetObject(PyExc_KeyError, key);
26753 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
26754 PyErr_Format(PyExc_ValueError,
26755 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
26759 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
26760 PyErr_Format(PyExc_ValueError,
26761 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
26762 index, (index == 1) ?
"" :
"s");
26766 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
26767 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
26771 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
26772 if (unlikely(!type)) {
26773 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26776 if (likely(__Pyx_TypeCheck(obj, type)))
26778 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
26779 Py_TYPE(obj)->tp_name, type->tp_name);
26784 #if CYTHON_USE_EXC_INFO_STACK
26785 static _PyErr_StackItem *
26786 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
26788 _PyErr_StackItem *exc_info = tstate->exc_info;
26789 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
26790 exc_info->previous_item != NULL)
26792 exc_info = exc_info->previous_item;
26799 #if CYTHON_FAST_THREAD_STATE
26800 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26801 #if CYTHON_USE_EXC_INFO_STACK
26802 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
26803 *type = exc_info->exc_type;
26804 *value = exc_info->exc_value;
26805 *tb = exc_info->exc_traceback;
26807 *type = tstate->exc_type;
26808 *value = tstate->exc_value;
26809 *tb = tstate->exc_traceback;
26812 Py_XINCREF(*value);
26815 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26816 PyObject *tmp_type, *tmp_value, *tmp_tb;
26817 #if CYTHON_USE_EXC_INFO_STACK
26818 _PyErr_StackItem *exc_info = tstate->exc_info;
26819 tmp_type = exc_info->exc_type;
26820 tmp_value = exc_info->exc_value;
26821 tmp_tb = exc_info->exc_traceback;
26822 exc_info->exc_type = type;
26823 exc_info->exc_value = value;
26824 exc_info->exc_traceback = tb;
26826 tmp_type = tstate->exc_type;
26827 tmp_value = tstate->exc_value;
26828 tmp_tb = tstate->exc_traceback;
26829 tstate->exc_type = type;
26830 tstate->exc_value = value;
26831 tstate->exc_traceback = tb;
26833 Py_XDECREF(tmp_type);
26834 Py_XDECREF(tmp_value);
26835 Py_XDECREF(tmp_tb);
26840 #if CYTHON_FAST_THREAD_STATE
26841 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
26843 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
26846 PyObject *local_type, *local_value, *local_tb;
26847 #if CYTHON_FAST_THREAD_STATE
26848 PyObject *tmp_type, *tmp_value, *tmp_tb;
26849 local_type = tstate->curexc_type;
26850 local_value = tstate->curexc_value;
26851 local_tb = tstate->curexc_traceback;
26852 tstate->curexc_type = 0;
26853 tstate->curexc_value = 0;
26854 tstate->curexc_traceback = 0;
26856 PyErr_Fetch(&local_type, &local_value, &local_tb);
26858 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
26859 #if CYTHON_FAST_THREAD_STATE
26860 if (unlikely(tstate->curexc_type))
26862 if (unlikely(PyErr_Occurred()))
26865 #if PY_MAJOR_VERSION >= 3
26867 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
26871 Py_XINCREF(local_tb);
26872 Py_XINCREF(local_type);
26873 Py_XINCREF(local_value);
26874 *type = local_type;
26875 *value = local_value;
26877 #if CYTHON_FAST_THREAD_STATE
26878 #if CYTHON_USE_EXC_INFO_STACK
26880 _PyErr_StackItem *exc_info = tstate->exc_info;
26881 tmp_type = exc_info->exc_type;
26882 tmp_value = exc_info->exc_value;
26883 tmp_tb = exc_info->exc_traceback;
26884 exc_info->exc_type = local_type;
26885 exc_info->exc_value = local_value;
26886 exc_info->exc_traceback = local_tb;
26889 tmp_type = tstate->exc_type;
26890 tmp_value = tstate->exc_value;
26891 tmp_tb = tstate->exc_traceback;
26892 tstate->exc_type = local_type;
26893 tstate->exc_value = local_value;
26894 tstate->exc_traceback = local_tb;
26896 Py_XDECREF(tmp_type);
26897 Py_XDECREF(tmp_value);
26898 Py_XDECREF(tmp_tb);
26900 PyErr_SetExcInfo(local_type, local_value, local_tb);
26907 Py_XDECREF(local_type);
26908 Py_XDECREF(local_value);
26909 Py_XDECREF(local_tb);
26914 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
26916 if (unlikely(!type)) {
26917 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26921 #if PY_MAJOR_VERSION == 2
26922 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
26926 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
26928 PyErr_Format(PyExc_TypeError,
26929 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
26930 name, type->tp_name, Py_TYPE(obj)->tp_name);
26935 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
26936 #if CYTHON_COMPILING_IN_PYPY
26937 return PyObject_RichCompareBool(s1, s2, equals);
26940 return (equals == Py_EQ);
26941 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
26942 const char *ps1, *ps2;
26943 Py_ssize_t length = PyBytes_GET_SIZE(s1);
26944 if (length != PyBytes_GET_SIZE(s2))
26945 return (equals == Py_NE);
26946 ps1 = PyBytes_AS_STRING(s1);
26947 ps2 = PyBytes_AS_STRING(s2);
26948 if (ps1[0] != ps2[0]) {
26949 return (equals == Py_NE);
26950 }
else if (length == 1) {
26951 return (equals == Py_EQ);
26954 #if CYTHON_USE_UNICODE_INTERNALS
26955 Py_hash_t hash1, hash2;
26956 hash1 = ((PyBytesObject*)s1)->ob_shash;
26957 hash2 = ((PyBytesObject*)s2)->ob_shash;
26958 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26959 return (equals == Py_NE);
26962 result = memcmp(ps1, ps2, (
size_t)length);
26963 return (equals == Py_EQ) ? (result == 0) : (result != 0);
26965 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
26966 return (equals == Py_NE);
26967 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
26968 return (equals == Py_NE);
26971 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26974 result = __Pyx_PyObject_IsTrue(py_result);
26975 Py_DECREF(py_result);
26982 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
26983 #if CYTHON_COMPILING_IN_PYPY
26984 return PyObject_RichCompareBool(s1, s2, equals);
26986 #if PY_MAJOR_VERSION < 3
26987 PyObject* owned_ref = NULL;
26989 int s1_is_unicode, s2_is_unicode;
26993 s1_is_unicode = PyUnicode_CheckExact(s1);
26994 s2_is_unicode = PyUnicode_CheckExact(s2);
26995 #if PY_MAJOR_VERSION < 3
26996 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
26997 owned_ref = PyUnicode_FromObject(s2);
26998 if (unlikely(!owned_ref))
27002 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
27003 owned_ref = PyUnicode_FromObject(s1);
27004 if (unlikely(!owned_ref))
27008 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
27009 return __Pyx_PyBytes_Equals(s1, s2, equals);
27012 if (s1_is_unicode & s2_is_unicode) {
27015 void *data1, *data2;
27016 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
27018 length = __Pyx_PyUnicode_GET_LENGTH(s1);
27019 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
27022 #if CYTHON_USE_UNICODE_INTERNALS
27024 Py_hash_t hash1, hash2;
27025 #if CYTHON_PEP393_ENABLED
27026 hash1 = ((PyASCIIObject*)s1)->hash;
27027 hash2 = ((PyASCIIObject*)s2)->hash;
27029 hash1 = ((PyUnicodeObject*)s1)->hash;
27030 hash2 = ((PyUnicodeObject*)s2)->hash;
27032 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
27037 kind = __Pyx_PyUnicode_KIND(s1);
27038 if (kind != __Pyx_PyUnicode_KIND(s2)) {
27041 data1 = __Pyx_PyUnicode_DATA(s1);
27042 data2 = __Pyx_PyUnicode_DATA(s2);
27043 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
27045 }
else if (length == 1) {
27048 int result = memcmp(data1, data2, (
size_t)(length * kind));
27049 #if PY_MAJOR_VERSION < 3
27050 Py_XDECREF(owned_ref);
27052 return (equals == Py_EQ) ? (result == 0) : (result != 0);
27054 }
else if ((s1 == Py_None) & s2_is_unicode) {
27056 }
else if ((s2 == Py_None) & s1_is_unicode) {
27060 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
27061 #if PY_MAJOR_VERSION < 3
27062 Py_XDECREF(owned_ref);
27066 result = __Pyx_PyObject_IsTrue(py_result);
27067 Py_DECREF(py_result);
27071 #if PY_MAJOR_VERSION < 3
27072 Py_XDECREF(owned_ref);
27074 return (equals == Py_EQ);
27076 #if PY_MAJOR_VERSION < 3
27077 Py_XDECREF(owned_ref);
27079 return (equals == Py_NE);
27084 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
27085 Py_ssize_t
q = a / b;
27086 Py_ssize_t
r = a -
q*b;
27087 q -= ((
r != 0) & ((
r ^ b) < 0));
27092 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
27093 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
27094 const char* encoding,
const char* errors,
27095 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
27097 if (unlikely((start < 0) | (stop < 0))) {
27098 size_t slen = strlen(cstring);
27099 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
27100 PyErr_SetString(PyExc_OverflowError,
27101 "c-string too long to convert to Python");
27104 length = (Py_ssize_t) slen;
27113 length = stop - start;
27114 if (unlikely(length <= 0))
27115 return PyUnicode_FromUnicode(NULL, 0);
27118 return decode_func(cstring, length, errors);
27120 return PyUnicode_Decode(cstring, length, encoding, errors);
27125 #if CYTHON_FAST_THREAD_STATE
27126 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
27127 PyObject *tmp_type, *tmp_value, *tmp_tb;
27128 #if CYTHON_USE_EXC_INFO_STACK
27129 _PyErr_StackItem *exc_info = tstate->exc_info;
27130 tmp_type = exc_info->exc_type;
27131 tmp_value = exc_info->exc_value;
27132 tmp_tb = exc_info->exc_traceback;
27133 exc_info->exc_type = *type;
27134 exc_info->exc_value = *value;
27135 exc_info->exc_traceback = *tb;
27137 tmp_type = tstate->exc_type;
27138 tmp_value = tstate->exc_value;
27139 tmp_tb = tstate->exc_traceback;
27140 tstate->exc_type = *type;
27141 tstate->exc_value = *value;
27142 tstate->exc_traceback = *tb;
27145 *value = tmp_value;
27149 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
27150 PyObject *tmp_type, *tmp_value, *tmp_tb;
27151 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
27152 PyErr_SetExcInfo(*type, *value, *tb);
27154 *value = tmp_value;
27160 #if CYTHON_COMPILING_IN_CPYTHON
27161 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
27167 return b == &PyBaseObject_Type;
27169 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
27171 if (a == b)
return 1;
27175 n = PyTuple_GET_SIZE(mro);
27176 for (i = 0; i <
n; i++) {
27177 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
27182 return __Pyx_InBases(a, b);
27184 #if PY_MAJOR_VERSION == 2
27185 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
27186 PyObject *exception, *value, *tb;
27188 __Pyx_PyThreadState_declare
27189 __Pyx_PyThreadState_assign
27190 __Pyx_ErrFetch(&exception, &value, &tb);
27191 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
27192 if (unlikely(res == -1)) {
27193 PyErr_WriteUnraisable(err);
27197 res = PyObject_IsSubclass(err, exc_type2);
27198 if (unlikely(res == -1)) {
27199 PyErr_WriteUnraisable(err);
27203 __Pyx_ErrRestore(exception, value, tb);
27207 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
27208 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
27210 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
27215 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
27217 assert(PyExceptionClass_Check(exc_type));
27218 n = PyTuple_GET_SIZE(tuple);
27219 #if PY_MAJOR_VERSION >= 3
27220 for (i=0; i<
n; i++) {
27221 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
27224 for (i=0; i<
n; i++) {
27225 PyObject *t = PyTuple_GET_ITEM(tuple, i);
27226 #if PY_MAJOR_VERSION < 3
27227 if (likely(exc_type == t))
return 1;
27229 if (likely(PyExceptionClass_Check(t))) {
27230 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
27236 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
27237 if (likely(err == exc_type))
return 1;
27238 if (likely(PyExceptionClass_Check(err))) {
27239 if (likely(PyExceptionClass_Check(exc_type))) {
27240 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
27241 }
else if (likely(PyTuple_Check(exc_type))) {
27242 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
27246 return PyErr_GivenExceptionMatches(err, exc_type);
27248 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
27249 assert(PyExceptionClass_Check(exc_type1));
27250 assert(PyExceptionClass_Check(exc_type2));
27251 if (likely(err == exc_type1 || err == exc_type2))
return 1;
27252 if (likely(PyExceptionClass_Check(err))) {
27253 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
27255 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
27260 #if !CYTHON_COMPILING_IN_PYPY
27261 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
27262 #if PY_MAJOR_VERSION < 3
27263 if (likely(PyInt_CheckExact(op1))) {
27264 const long b = intval;
27266 long a = PyInt_AS_LONG(op1);
27267 x = (long)((
unsigned long)a + b);
27268 if (likely((x^a) >= 0 || (x^b) >= 0))
27269 return PyInt_FromLong(x);
27270 return PyLong_Type.tp_as_number->nb_add(op1, op2);
27273 #if CYTHON_USE_PYLONG_INTERNALS
27274 if (likely(PyLong_CheckExact(op1))) {
27275 const long b = intval;
27277 #ifdef HAVE_LONG_LONG
27278 const PY_LONG_LONG llb = intval;
27279 PY_LONG_LONG lla, llx;
27281 const digit* digits = ((PyLongObject*)op1)->ob_digit;
27282 const Py_ssize_t size = Py_SIZE(op1);
27283 if (likely(__Pyx_sst_abs(size) <= 1)) {
27284 a = likely(size) ? digits[0] : 0;
27285 if (size == -1) a = -a;
27289 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27290 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27292 #ifdef HAVE_LONG_LONG
27293 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
27294 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27298 CYTHON_FALLTHROUGH;
27300 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27301 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27303 #ifdef HAVE_LONG_LONG
27304 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
27305 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27309 CYTHON_FALLTHROUGH;
27311 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27312 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27314 #ifdef HAVE_LONG_LONG
27315 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
27316 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27320 CYTHON_FALLTHROUGH;
27322 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27323 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27325 #ifdef HAVE_LONG_LONG
27326 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
27327 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27331 CYTHON_FALLTHROUGH;
27333 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27334 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27336 #ifdef HAVE_LONG_LONG
27337 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
27338 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27342 CYTHON_FALLTHROUGH;
27344 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27345 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
27347 #ifdef HAVE_LONG_LONG
27348 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
27349 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
27353 CYTHON_FALLTHROUGH;
27354 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
27358 return PyLong_FromLong(x);
27359 #ifdef HAVE_LONG_LONG
27362 return PyLong_FromLongLong(llx);
27368 if (PyFloat_CheckExact(op1)) {
27369 const long b = intval;
27370 double a = PyFloat_AS_DOUBLE(op1);
27372 PyFPE_START_PROTECT(
"add",
return NULL)
27373 result = ((double)a) + (double)b;
27374 PyFPE_END_PROTECT(result)
27375 return PyFloat_FromDouble(result);
27377 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
27382 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
27383 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
27387 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
27390 q -= ((
r != 0) & ((
r ^ b) < 0));
27395 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
27396 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
27397 PyErr_Format(PyExc_AttributeError,
27398 #
if PY_MAJOR_VERSION >= 3
27399 "'%.50s' object has no attribute '%U'",
27400 tp->tp_name, attr_name);
27402 "'%.50s' object has no attribute '%.400s'",
27403 tp->tp_name, PyString_AS_STRING(attr_name));
27407 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
27409 PyTypeObject *tp = Py_TYPE(obj);
27410 if (unlikely(!PyString_Check(attr_name))) {
27411 return PyObject_GenericGetAttr(obj, attr_name);
27413 assert(!tp->tp_dictoffset);
27414 descr = _PyType_Lookup(tp, attr_name);
27415 if (unlikely(!descr)) {
27416 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
27419 #if PY_MAJOR_VERSION < 3
27420 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
27423 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
27425 PyObject *res =
f(descr, obj, (PyObject *)tp);
27435 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
27436 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
27437 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
27438 return PyObject_GenericGetAttr(obj, attr_name);
27440 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
27445 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
27447 PyObject *name_attr;
27448 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
27449 if (likely(name_attr)) {
27450 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
27454 if (unlikely(ret < 0)) {
27458 Py_XDECREF(name_attr);
27461 static int __Pyx_setup_reduce(PyObject* type_obj) {
27463 PyObject *object_reduce = NULL;
27464 PyObject *object_reduce_ex = NULL;
27465 PyObject *reduce = NULL;
27466 PyObject *reduce_ex = NULL;
27467 PyObject *reduce_cython = NULL;
27468 PyObject *setstate = NULL;
27469 PyObject *setstate_cython = NULL;
27470 #if CYTHON_USE_PYTYPE_LOOKUP
27471 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
27473 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
27475 #if CYTHON_USE_PYTYPE_LOOKUP
27476 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
27478 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
27480 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
27481 if (reduce_ex == object_reduce_ex) {
27482 #if CYTHON_USE_PYTYPE_LOOKUP
27483 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
27485 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
27487 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
27488 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
27489 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
27490 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
27491 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
27492 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
27493 if (!setstate) PyErr_Clear();
27494 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
27495 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
27496 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
27497 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
27499 PyType_Modified((PyTypeObject*)type_obj);
27504 if (!PyErr_Occurred())
27505 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
27508 #if !CYTHON_USE_PYTYPE_LOOKUP
27509 Py_XDECREF(object_reduce);
27510 Py_XDECREF(object_reduce_ex);
27512 Py_XDECREF(reduce);
27513 Py_XDECREF(reduce_ex);
27514 Py_XDECREF(reduce_cython);
27515 Py_XDECREF(setstate);
27516 Py_XDECREF(setstate_cython);
27521 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
27522 #if PY_VERSION_HEX >= 0x02070000
27523 PyObject *ob = PyCapsule_New(vtable, 0, 0);
27525 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
27529 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
27539 #ifndef __PYX_HAVE_RT_ImportType
27540 #define __PYX_HAVE_RT_ImportType
27541 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
27542 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
27544 PyObject *result = 0;
27546 Py_ssize_t basicsize;
27547 #ifdef Py_LIMITED_API
27548 PyObject *py_basicsize;
27550 result = PyObject_GetAttrString(module, class_name);
27553 if (!PyType_Check(result)) {
27554 PyErr_Format(PyExc_TypeError,
27555 "%.200s.%.200s is not a type object",
27556 module_name, class_name);
27559 #ifndef Py_LIMITED_API
27560 basicsize = ((PyTypeObject *)result)->tp_basicsize;
27562 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
27565 basicsize = PyLong_AsSsize_t(py_basicsize);
27566 Py_DECREF(py_basicsize);
27568 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
27571 if ((
size_t)basicsize < size) {
27572 PyErr_Format(PyExc_ValueError,
27573 "%.200s.%.200s size changed, may indicate binary incompatibility. "
27574 "Expected %zd from C header, got %zd from PyObject",
27575 module_name, class_name, size, basicsize);
27578 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
27579 PyErr_Format(PyExc_ValueError,
27580 "%.200s.%.200s size changed, may indicate binary incompatibility. "
27581 "Expected %zd from C header, got %zd from PyObject",
27582 module_name, class_name, size, basicsize);
27585 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
27586 PyOS_snprintf(warning,
sizeof(warning),
27587 "%s.%s size changed, may indicate binary incompatibility. "
27588 "Expected %zd from C header, got %zd from PyObject",
27589 module_name, class_name, size, basicsize);
27590 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
27592 return (PyTypeObject *)result;
27594 Py_XDECREF(result);
27600 #ifndef CYTHON_CLINE_IN_TRACEBACK
27601 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
27602 PyObject *use_cline;
27603 PyObject *ptype, *pvalue, *ptraceback;
27604 #if CYTHON_COMPILING_IN_CPYTHON
27605 PyObject **cython_runtime_dict;
27607 if (unlikely(!__pyx_cython_runtime)) {
27610 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27611 #if CYTHON_COMPILING_IN_CPYTHON
27612 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
27613 if (likely(cython_runtime_dict)) {
27614 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
27615 use_cline, *cython_runtime_dict,
27616 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
27620 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
27621 if (use_cline_obj) {
27622 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
27623 Py_DECREF(use_cline_obj);
27631 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
27633 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
27636 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27642 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
27643 int start = 0, mid = 0, end = count - 1;
27644 if (end >= 0 && code_line > entries[end].code_line) {
27647 while (start < end) {
27648 mid = start + (end - start) / 2;
27649 if (code_line < entries[mid].code_line) {
27651 }
else if (code_line > entries[mid].code_line) {
27657 if (code_line <= entries[mid].code_line) {
27663 static PyCodeObject *__pyx_find_code_object(
int code_line) {
27664 PyCodeObject* code_object;
27666 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27669 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27670 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
27673 code_object = __pyx_code_cache.entries[
pos].code_object;
27674 Py_INCREF(code_object);
27675 return code_object;
27677 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
27679 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27680 if (unlikely(!code_line)) {
27683 if (unlikely(!entries)) {
27684 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
27685 if (likely(entries)) {
27686 __pyx_code_cache.entries = entries;
27687 __pyx_code_cache.max_count = 64;
27688 __pyx_code_cache.count = 1;
27689 entries[0].code_line = code_line;
27690 entries[0].code_object = code_object;
27691 Py_INCREF(code_object);
27695 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27696 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
27697 PyCodeObject* tmp = entries[
pos].code_object;
27698 entries[
pos].code_object = code_object;
27702 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27703 int new_max = __pyx_code_cache.max_count + 64;
27704 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27705 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
27706 if (unlikely(!entries)) {
27709 __pyx_code_cache.entries = entries;
27710 __pyx_code_cache.max_count = new_max;
27712 for (i=__pyx_code_cache.count; i>
pos; i--) {
27713 entries[i] = entries[i-1];
27715 entries[
pos].code_line = code_line;
27716 entries[
pos].code_object = code_object;
27717 __pyx_code_cache.count++;
27718 Py_INCREF(code_object);
27722 #include "compile.h"
27723 #include "frameobject.h"
27724 #include "traceback.h"
27725 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27726 const char *funcname,
int c_line,
27727 int py_line,
const char *filename) {
27728 PyCodeObject *py_code = 0;
27729 PyObject *py_srcfile = 0;
27730 PyObject *py_funcname = 0;
27731 #if PY_MAJOR_VERSION < 3
27732 py_srcfile = PyString_FromString(filename);
27734 py_srcfile = PyUnicode_FromString(filename);
27736 if (!py_srcfile)
goto bad;
27738 #if PY_MAJOR_VERSION < 3
27739 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27741 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27745 #if PY_MAJOR_VERSION < 3
27746 py_funcname = PyString_FromString(funcname);
27748 py_funcname = PyUnicode_FromString(funcname);
27751 if (!py_funcname)
goto bad;
27752 py_code = __Pyx_PyCode_New(
27769 Py_DECREF(py_srcfile);
27770 Py_DECREF(py_funcname);
27773 Py_XDECREF(py_srcfile);
27774 Py_XDECREF(py_funcname);
27777 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
27778 int py_line,
const char *filename) {
27779 PyCodeObject *py_code = 0;
27780 PyFrameObject *py_frame = 0;
27781 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27783 c_line = __Pyx_CLineForTraceback(tstate, c_line);
27785 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27787 py_code = __Pyx_CreateCodeObjectForTraceback(
27788 funcname, c_line, py_line, filename);
27789 if (!py_code)
goto bad;
27790 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27792 py_frame = PyFrame_New(
27798 if (!py_frame)
goto bad;
27799 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27800 PyTraceBack_Here(py_frame);
27802 Py_XDECREF(py_code);
27803 Py_XDECREF(py_frame);
27806 #if PY_MAJOR_VERSION < 3
27807 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
27808 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
27809 if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
27810 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
27811 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
27812 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27815 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27816 PyObject *obj = view->obj;
27818 if (PyObject_CheckBuffer(obj)) {
27819 PyBuffer_Release(view);
27823 else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
27832 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
27834 int i, index, step, start;
27835 Py_ssize_t itemsize = mvs.memview->view.itemsize;
27836 if (order ==
'F') {
27843 for (i = 0; i < ndim; i++) {
27844 index = start + step * i;
27845 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27847 itemsize *= mvs.shape[index];
27854 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27855 void **out_start,
void **out_end,
27856 int ndim,
size_t itemsize)
27860 start = end = slice->data;
27861 for (i = 0; i < ndim; i++) {
27862 Py_ssize_t stride = slice->strides[i];
27863 Py_ssize_t extent = slice->shape[i];
27865 *out_start = *out_end = start;
27869 end += stride * (extent - 1);
27871 start += stride * (extent - 1);
27874 *out_start = start;
27875 *out_end = end + itemsize;
27878 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27879 __Pyx_memviewslice *slice2,
27880 int ndim,
size_t itemsize)
27882 void *start1, *end1, *start2, *end2;
27883 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27884 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27885 return (start1 < end2) && (start2 < end1);
27889 static CYTHON_INLINE PyObject *
27890 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
27893 #if PY_VERSION_HEX >= 0x02070000
27894 cobj = PyCapsule_New(p, sig, NULL);
27896 cobj = PyCObject_FromVoidPtr(p, NULL);
27902 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp) {
27903 return (PyObject *) PyFloat_FromDouble(*(
double *) itemp);
27905 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj) {
27906 double value = __pyx_PyFloat_AsDouble(obj);
27907 if ((value == (
double)-1) && PyErr_Occurred())
27909 *(
double *) itemp = value;
27914 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
27920 S.u32 = 0x01020304;
27921 return S.u8[0] == 4;
27925 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27926 __Pyx_BufFmt_StackElem* stack,
27927 __Pyx_TypeInfo* type) {
27928 stack[0].field = &ctx->root;
27929 stack[0].parent_offset = 0;
27930 ctx->root.type = type;
27931 ctx->root.name =
"buffer dtype";
27932 ctx->root.offset = 0;
27934 ctx->head->field = &ctx->root;
27935 ctx->fmt_offset = 0;
27936 ctx->head->parent_offset = 0;
27937 ctx->new_packmode =
'@';
27938 ctx->enc_packmode =
'@';
27939 ctx->new_count = 1;
27940 ctx->enc_count = 0;
27942 ctx->is_complex = 0;
27943 ctx->is_valid_array = 0;
27944 ctx->struct_alignment = 0;
27945 while (type->typegroup ==
'S') {
27947 ctx->head->field = type->fields;
27948 ctx->head->parent_offset = 0;
27949 type = type->fields->type;
27952 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
27954 const char* t = *ts;
27955 if (*t < '0' || *t >
'9') {
27958 count = *t++ -
'0';
27959 while (*t >=
'0' && *t <
'9') {
27961 count += *t++ -
'0';
27967 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
27968 int number = __Pyx_BufFmt_ParseNumber(ts);
27970 PyErr_Format(PyExc_ValueError,\
27971 "Does not understand character buffer dtype format string ('%c')", **ts);
27974 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
27975 PyErr_Format(PyExc_ValueError,
27976 "Unexpected format string character: '%c'", ch);
27978 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
27980 case 'c':
return "'char'";
27981 case 'b':
return "'signed char'";
27982 case 'B':
return "'unsigned char'";
27983 case 'h':
return "'short'";
27984 case 'H':
return "'unsigned short'";
27985 case 'i':
return "'int'";
27986 case 'I':
return "'unsigned int'";
27987 case 'l':
return "'long'";
27988 case 'L':
return "'unsigned long'";
27989 case 'q':
return "'long long'";
27990 case 'Q':
return "'unsigned long long'";
27991 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
27992 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
27993 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
27994 case 'T':
return "a struct";
27995 case 'O':
return "Python object";
27996 case 'P':
return "a pointer";
27997 case 's':
case 'p':
return "a string";
27998 case 0:
return "end";
27999 default:
return "unparseable format string";
28002 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
28004 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28005 case 'h':
case 'H':
return 2;
28006 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
28007 case 'q':
case 'Q':
return 8;
28008 case 'f':
return (is_complex ? 8 : 4);
28009 case 'd':
return (is_complex ? 16 : 8);
28011 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
28014 case 'O':
case 'P':
return sizeof(
void*);
28016 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28020 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
28022 case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28023 case 'h':
case 'H':
return sizeof(short);
28024 case 'i':
case 'I':
return sizeof(int);
28025 case 'l':
case 'L':
return sizeof(long);
28026 #ifdef HAVE_LONG_LONG
28027 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
28029 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
28030 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
28031 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
28032 case 'O':
case 'P':
return sizeof(
void*);
28034 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28039 typedef struct {
char c;
short x; } __Pyx_st_short;
28040 typedef struct {
char c;
int x; } __Pyx_st_int;
28041 typedef struct {
char c;
long x; } __Pyx_st_long;
28042 typedef struct {
char c;
float x; } __Pyx_st_float;
28043 typedef struct {
char c;
double x; } __Pyx_st_double;
28044 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
28045 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
28046 #ifdef HAVE_LONG_LONG
28047 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
28049 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
28051 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28052 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
28053 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
28054 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
28055 #ifdef HAVE_LONG_LONG
28056 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
28058 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
28059 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
28060 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
28061 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
28063 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28071 typedef struct {
short x;
char c; } __Pyx_pad_short;
28072 typedef struct {
int x;
char c; } __Pyx_pad_int;
28073 typedef struct {
long x;
char c; } __Pyx_pad_long;
28074 typedef struct {
float x;
char c; } __Pyx_pad_float;
28075 typedef struct {
double x;
char c; } __Pyx_pad_double;
28076 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
28077 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
28078 #ifdef HAVE_LONG_LONG
28079 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
28081 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
28083 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28084 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
28085 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
28086 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
28087 #ifdef HAVE_LONG_LONG
28088 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
28090 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
28091 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
28092 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
28093 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
28095 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28099 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
28103 case 'b':
case 'h':
case 'i':
28104 case 'l':
case 'q':
case 's':
case 'p':
28106 case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
28108 case 'f':
case 'd':
case 'g':
28109 return (is_complex ?
'C' :
'R');
28115 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28120 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
28121 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
28122 const char* expected;
28124 if (ctx->head == NULL) {
28128 expected = ctx->head->field->type->name;
28131 PyErr_Format(PyExc_ValueError,
28132 "Buffer dtype mismatch, expected %s%s%s but got %s",
28133 quote, expected, quote,
28134 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
28136 __Pyx_StructField* field = ctx->head->field;
28137 __Pyx_StructField* parent = (ctx->head - 1)->field;
28138 PyErr_Format(PyExc_ValueError,
28139 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
28140 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
28141 parent->type->name, field->name);
28144 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
28146 size_t size, offset, arraysize = 1;
28147 if (ctx->enc_type == 0)
return 0;
28148 if (ctx->head->field->type->arraysize[0]) {
28150 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
28151 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
28153 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
28154 PyErr_Format(PyExc_ValueError,
28155 "Expected a dimension of size %zu, got %zu",
28156 ctx->head->field->type->arraysize[0], ctx->enc_count);
28160 if (!ctx->is_valid_array) {
28161 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
28162 ctx->head->field->type->ndim, ndim);
28165 for (i = 0; i < ctx->head->field->type->ndim; i++) {
28166 arraysize *= ctx->head->field->type->arraysize[i];
28168 ctx->is_valid_array = 0;
28169 ctx->enc_count = 1;
28171 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28173 __Pyx_StructField* field = ctx->head->field;
28174 __Pyx_TypeInfo* type = field->type;
28175 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
28176 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28178 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28180 if (ctx->enc_packmode ==
'@') {
28181 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28182 size_t align_mod_offset;
28183 if (align_at == 0)
return -1;
28184 align_mod_offset = ctx->fmt_offset % align_at;
28185 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28186 if (ctx->struct_alignment == 0)
28187 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28190 if (type->size != size || type->typegroup != group) {
28191 if (type->typegroup ==
'C' && type->fields != NULL) {
28192 size_t parent_offset = ctx->head->parent_offset + field->offset;
28194 ctx->head->field = type->fields;
28195 ctx->head->parent_offset = parent_offset;
28198 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
28200 __Pyx_BufFmt_RaiseExpected(ctx);
28204 offset = ctx->head->parent_offset + field->offset;
28205 if (ctx->fmt_offset != offset) {
28206 PyErr_Format(PyExc_ValueError,
28207 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
28208 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28211 ctx->fmt_offset += size;
28213 ctx->fmt_offset += (arraysize - 1) * size;
28216 if (field == &ctx->root) {
28218 if (ctx->enc_count != 0) {
28219 __Pyx_BufFmt_RaiseExpected(ctx);
28224 ctx->head->field = ++field;
28225 if (field->type == NULL) {
28227 field = ctx->head->field;
28229 }
else if (field->type->typegroup ==
'S') {
28230 size_t parent_offset = ctx->head->parent_offset + field->offset;
28231 if (field->type->fields->type == NULL)
continue;
28232 field = field->type->fields;
28234 ctx->head->field = field;
28235 ctx->head->parent_offset = parent_offset;
28241 }
while (ctx->enc_count);
28243 ctx->is_complex = 0;
28247 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
28249 const char *ts = *tsp;
28251 int ndim = ctx->head->field->type->ndim;
28254 if (ctx->new_count != 1) {
28255 PyErr_SetString(PyExc_ValueError,
28256 "Cannot handle repeated arrays in format string");
28259 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28260 while (*ts && *ts !=
')') {
28262 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
28265 number = __Pyx_BufFmt_ExpectNumber(&ts);
28266 if (
number == -1)
return NULL;
28267 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
28268 return PyErr_Format(PyExc_ValueError,
28269 "Expected a dimension of size %zu, got %d",
28270 ctx->head->field->type->arraysize[i],
number);
28271 if (*ts !=
',' && *ts !=
')')
28272 return PyErr_Format(PyExc_ValueError,
28273 "Expected a comma in format string, got '%c'", *ts);
28274 if (*ts ==
',') ts++;
28278 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
28279 ctx->head->field->type->ndim, i);
28281 PyErr_SetString(PyExc_ValueError,
28282 "Unexpected end of format string, expected ')'");
28285 ctx->is_valid_array = 1;
28286 ctx->new_count = 1;
28290 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
28295 if (ctx->enc_type != 0 && ctx->head == NULL) {
28296 __Pyx_BufFmt_RaiseExpected(ctx);
28299 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28300 if (ctx->head != NULL) {
28301 __Pyx_BufFmt_RaiseExpected(ctx);
28311 if (!__Pyx_Is_Little_Endian()) {
28312 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
28315 ctx->new_packmode =
'=';
28320 if (__Pyx_Is_Little_Endian()) {
28321 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
28324 ctx->new_packmode =
'=';
28330 ctx->new_packmode = *ts++;
28334 const char* ts_after_sub;
28335 size_t i, struct_count = ctx->new_count;
28336 size_t struct_alignment = ctx->struct_alignment;
28337 ctx->new_count = 1;
28340 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
28343 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28345 ctx->enc_count = 0;
28346 ctx->struct_alignment = 0;
28349 for (i = 0; i != struct_count; ++i) {
28350 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
28351 if (!ts_after_sub)
return NULL;
28354 if (struct_alignment) ctx->struct_alignment = struct_alignment;
28359 size_t alignment = ctx->struct_alignment;
28361 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28363 if (alignment && ctx->fmt_offset % alignment) {
28364 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
28369 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28370 ctx->fmt_offset += ctx->new_count;
28371 ctx->new_count = 1;
28372 ctx->enc_count = 0;
28374 ctx->enc_packmode = ctx->new_packmode;
28380 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
28381 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
28384 CYTHON_FALLTHROUGH;
28385 case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
28386 case 'l':
case 'L':
case 'q':
case 'Q':
28387 case 'f':
case 'd':
case 'g':
28388 case 'O':
case 'p':
28389 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
28390 ctx->enc_packmode == ctx->new_packmode) {
28391 ctx->enc_count += ctx->new_count;
28392 ctx->new_count = 1;
28397 CYTHON_FALLTHROUGH;
28399 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28400 ctx->enc_count = ctx->new_count;
28401 ctx->enc_packmode = ctx->new_packmode;
28402 ctx->enc_type = *ts;
28403 ctx->is_complex = got_Z;
28405 ctx->new_count = 1;
28410 while(*ts !=
':') ++ts;
28414 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
28418 int number = __Pyx_BufFmt_ExpectNumber(&ts);
28419 if (
number == -1)
return NULL;
28420 ctx->new_count = (size_t)
number;
28428 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
28435 if (a->size != b->size || a->typegroup != b->typegroup ||
28436 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
28437 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
28438 return a->size == b->size;
28444 for (i = 0; i < a->ndim; i++)
28445 if (a->arraysize[i] != b->arraysize[i])
28448 if (a->typegroup ==
'S') {
28449 if (a->flags != b->flags)
28451 if (a->fields || b->fields) {
28452 if (!(a->fields && b->fields))
28454 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
28455 __Pyx_StructField *field_a = a->fields + i;
28456 __Pyx_StructField *field_b = b->fields + i;
28457 if (field_a->offset != field_b->offset ||
28458 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
28461 return !a->fields[i].type && !b->fields[i].type;
28469 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
28471 if (buf->shape[dim] <= 1)
28473 if (buf->strides) {
28474 if (spec & __Pyx_MEMVIEW_CONTIG) {
28475 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
28476 if (buf->strides[dim] !=
sizeof(
void *)) {
28477 PyErr_Format(PyExc_ValueError,
28478 "Buffer is not indirectly contiguous "
28479 "in dimension %d.", dim);
28482 }
else if (buf->strides[dim] != buf->itemsize) {
28483 PyErr_SetString(PyExc_ValueError,
28484 "Buffer and memoryview are not contiguous "
28485 "in the same dimension.");
28489 if (spec & __Pyx_MEMVIEW_FOLLOW) {
28490 Py_ssize_t stride = buf->strides[dim];
28493 if (stride < buf->itemsize) {
28494 PyErr_SetString(PyExc_ValueError,
28495 "Buffer and memoryview are not contiguous "
28496 "in the same dimension.");
28501 if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
28502 PyErr_Format(PyExc_ValueError,
28503 "C-contiguous buffer is not contiguous in "
28504 "dimension %d", dim);
28506 }
else if (spec & (__Pyx_MEMVIEW_PTR)) {
28507 PyErr_Format(PyExc_ValueError,
28508 "C-contiguous buffer is not indirect in "
28509 "dimension %d", dim);
28511 }
else if (buf->suboffsets) {
28512 PyErr_SetString(PyExc_ValueError,
28513 "Buffer exposes suboffsets but no strides");
28522 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
28524 if (spec & __Pyx_MEMVIEW_DIRECT) {
28525 if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
28526 PyErr_Format(PyExc_ValueError,
28527 "Buffer not compatible with direct access "
28528 "in dimension %d.", dim);
28532 if (spec & __Pyx_MEMVIEW_PTR) {
28533 if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
28534 PyErr_Format(PyExc_ValueError,
28535 "Buffer is not indirectly accessible "
28536 "in dimension %d.", dim);
28545 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
28548 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
28549 Py_ssize_t stride = 1;
28550 for (i = 0; i < ndim; i++) {
28551 if (stride * buf->itemsize != buf->strides[i] &&
28554 PyErr_SetString(PyExc_ValueError,
28555 "Buffer not fortran contiguous.");
28558 stride = stride * buf->shape[i];
28560 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
28561 Py_ssize_t stride = 1;
28562 for (i = ndim - 1; i >- 1; i--) {
28563 if (stride * buf->itemsize != buf->strides[i] &&
28564 buf->shape[i] > 1) {
28565 PyErr_SetString(PyExc_ValueError,
28566 "Buffer not C contiguous.");
28569 stride = stride * buf->shape[i];
28576 static int __Pyx_ValidateAndInit_memviewslice(
28581 __Pyx_TypeInfo *dtype,
28582 __Pyx_BufFmt_StackElem stack[],
28583 __Pyx_memviewslice *memviewslice,
28584 PyObject *original_obj)
28586 struct __pyx_memoryview_obj *memview, *new_memview;
28587 __Pyx_RefNannyDeclarations
28589 int i, spec = 0, retval = -1;
28590 __Pyx_BufFmt_Context ctx;
28591 int from_memoryview = __pyx_memoryview_check(original_obj);
28592 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
28593 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
28594 original_obj)->typeinfo)) {
28595 memview = (
struct __pyx_memoryview_obj *) original_obj;
28596 new_memview = NULL;
28598 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28599 original_obj, buf_flags, 0, dtype);
28600 new_memview = memview;
28601 if (unlikely(!memview))
28604 buf = &memview->view;
28605 if (buf->ndim != ndim) {
28606 PyErr_Format(PyExc_ValueError,
28607 "Buffer has wrong number of dimensions (expected %d, got %d)",
28612 __Pyx_BufFmt_Init(&ctx, stack, dtype);
28613 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
28615 if ((
unsigned) buf->itemsize != dtype->size) {
28616 PyErr_Format(PyExc_ValueError,
28617 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
28618 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
28620 (buf->itemsize > 1) ?
"s" :
"",
28623 (dtype->size > 1) ?
"s" :
"");
28626 for (i = 0; i < ndim; i++) {
28627 spec = axes_specs[i];
28628 if (!__pyx_check_strides(buf, i, ndim, spec))
28630 if (!__pyx_check_suboffsets(buf, i, ndim, spec))
28633 if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
28635 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
28636 new_memview != NULL) == -1)) {
28642 Py_XDECREF(new_memview);
28645 __Pyx_RefNannyFinishContext();
28650 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
28651 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28652 __Pyx_BufFmt_StackElem stack[1];
28653 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28655 if (obj == Py_None) {
28656 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28659 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28660 PyBUF_RECORDS_RO | writable_flag, 1,
28661 &__Pyx_TypeInfo_double, stack,
28663 if (unlikely(retcode == -1))
28667 result.memview = NULL;
28668 result.data = NULL;
28673 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
28674 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
28675 const int is_unsigned = neg_one > const_zero;
28677 if (
sizeof(
int) <
sizeof(long)) {
28678 return PyInt_FromLong((
long) value);
28679 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28680 return PyLong_FromUnsignedLong((
unsigned long) value);
28681 #ifdef HAVE_LONG_LONG
28682 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28683 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28687 if (
sizeof(
int) <=
sizeof(
long)) {
28688 return PyInt_FromLong((
long) value);
28689 #ifdef HAVE_LONG_LONG
28690 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28691 return PyLong_FromLongLong((PY_LONG_LONG) value);
28696 int one = 1;
int little = (int)*(
unsigned char *)&one;
28697 unsigned char *bytes = (
unsigned char *)&value;
28698 return _PyLong_FromByteArray(bytes,
sizeof(
int),
28699 little, !is_unsigned);
28704 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
28705 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
28706 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
28707 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
28708 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
28710 func_type value = func_value;\
28711 if (sizeof(target_type) < sizeof(func_type)) {\
28712 if (unlikely(value != (func_type) (target_type) value)) {\
28713 func_type zero = 0;\
28714 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
28715 return (target_type) -1;\
28716 if (is_unsigned && unlikely(value < zero))\
28717 goto raise_neg_overflow;\
28719 goto raise_overflow;\
28722 return (target_type) value;\
28726 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28727 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
28728 const int is_unsigned = neg_one > const_zero;
28730 if (
sizeof(
long) <
sizeof(long)) {
28731 return PyInt_FromLong((
long) value);
28732 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28733 return PyLong_FromUnsignedLong((
unsigned long) value);
28734 #ifdef HAVE_LONG_LONG
28735 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28736 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28740 if (
sizeof(
long) <=
sizeof(
long)) {
28741 return PyInt_FromLong((
long) value);
28742 #ifdef HAVE_LONG_LONG
28743 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28744 return PyLong_FromLongLong((PY_LONG_LONG) value);
28749 int one = 1;
int little = (int)*(
unsigned char *)&one;
28750 unsigned char *bytes = (
unsigned char *)&value;
28751 return _PyLong_FromByteArray(bytes,
sizeof(
long),
28752 little, !is_unsigned);
28757 #if CYTHON_CCOMPLEX
28759 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
28760 return ::std::complex< float >(x, y);
28763 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
28764 return x + y*(__pyx_t_float_complex)_Complex_I;
28768 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
28769 __pyx_t_float_complex
z;
28777 #if CYTHON_CCOMPLEX
28779 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28780 return (a.real == b.real) && (a.imag == b.imag);
28782 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28783 __pyx_t_float_complex
z;
28784 z.real = a.real + b.real;
28785 z.imag = a.imag + b.imag;
28788 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28789 __pyx_t_float_complex
z;
28790 z.real = a.real - b.real;
28791 z.imag = a.imag - b.imag;
28794 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28795 __pyx_t_float_complex
z;
28796 z.real = a.real * b.real - a.imag * b.imag;
28797 z.imag = a.real * b.imag + a.imag * b.real;
28801 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28803 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28804 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
28805 if (b.real == 0 && b.imag == 0) {
28806 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
28808 float r = b.imag / b.real;
28809 float s = 1.0 / (b.real + b.imag *
r);
28810 return __pyx_t_float_complex_from_parts(
28811 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
28814 float r = b.real / b.imag;
28815 float s = 1.0 / (b.imag + b.real *
r);
28816 return __pyx_t_float_complex_from_parts(
28817 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
28821 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28823 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28825 float denom = b.real * b.real + b.imag * b.imag;
28826 return __pyx_t_float_complex_from_parts(
28827 (a.real * b.real + a.imag * b.imag) / denom,
28828 (a.imag * b.real - a.real * b.imag) / denom);
28832 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
28833 __pyx_t_float_complex
z;
28838 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
28839 return (a.real == 0) && (a.imag == 0);
28841 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
28842 __pyx_t_float_complex
z;
28848 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
28849 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28850 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
28852 return hypotf(
z.real,
z.imag);
28855 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28856 __pyx_t_float_complex
z;
28857 float r, lnr, theta, z_r, z_theta;
28858 if (b.imag == 0 && b.real == (
int)b.real) {
28860 float denom = a.real * a.real + a.imag * a.imag;
28861 a.real = a.real / denom;
28862 a.imag = -a.imag / denom;
28865 switch ((
int)b.real) {
28873 z = __Pyx_c_prod_float(a, a);
28874 return __Pyx_c_prod_float(a, a);
28876 z = __Pyx_c_prod_float(a, a);
28877 return __Pyx_c_prod_float(
z, a);
28879 z = __Pyx_c_prod_float(a, a);
28880 return __Pyx_c_prod_float(
z,
z);
28886 }
else if (b.imag == 0) {
28887 z.real = powf(a.real, b.real);
28890 }
else if (a.real > 0) {
28895 theta = atan2f(0, -1);
28898 r = __Pyx_c_abs_float(a);
28899 theta = atan2f(a.imag, a.real);
28902 z_r = expf(lnr * b.real - theta * b.imag);
28903 z_theta = theta * b.real + lnr * b.imag;
28904 z.real = z_r * cosf(z_theta);
28905 z.imag = z_r * sinf(z_theta);
28912 #if CYTHON_CCOMPLEX
28914 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28915 return ::std::complex< double >(x, y);
28918 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28919 return x + y*(__pyx_t_double_complex)_Complex_I;
28923 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28924 __pyx_t_double_complex
z;
28932 #if CYTHON_CCOMPLEX
28934 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28935 return (a.real == b.real) && (a.imag == b.imag);
28937 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28938 __pyx_t_double_complex
z;
28939 z.real = a.real + b.real;
28940 z.imag = a.imag + b.imag;
28943 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28944 __pyx_t_double_complex
z;
28945 z.real = a.real - b.real;
28946 z.imag = a.imag - b.imag;
28949 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28950 __pyx_t_double_complex
z;
28951 z.real = a.real * b.real - a.imag * b.imag;
28952 z.imag = a.real * b.imag + a.imag * b.real;
28956 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28958 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28959 }
else if (fabs(b.real) >= fabs(b.imag)) {
28960 if (b.real == 0 && b.imag == 0) {
28961 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
28963 double r = b.imag / b.real;
28964 double s = 1.0 / (b.real + b.imag *
r);
28965 return __pyx_t_double_complex_from_parts(
28966 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
28969 double r = b.real / b.imag;
28970 double s = 1.0 / (b.imag + b.real *
r);
28971 return __pyx_t_double_complex_from_parts(
28972 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
28976 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28978 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28980 double denom = b.real * b.real + b.imag * b.imag;
28981 return __pyx_t_double_complex_from_parts(
28982 (a.real * b.real + a.imag * b.imag) / denom,
28983 (a.imag * b.real - a.real * b.imag) / denom);
28987 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
28988 __pyx_t_double_complex
z;
28993 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
28994 return (a.real == 0) && (a.imag == 0);
28996 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
28997 __pyx_t_double_complex
z;
29003 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
29004 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
29005 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
29007 return hypot(
z.real,
z.imag);
29010 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
29011 __pyx_t_double_complex
z;
29012 double r, lnr, theta, z_r, z_theta;
29013 if (b.imag == 0 && b.real == (
int)b.real) {
29015 double denom = a.real * a.real + a.imag * a.imag;
29016 a.real = a.real / denom;
29017 a.imag = -a.imag / denom;
29020 switch ((
int)b.real) {
29028 z = __Pyx_c_prod_double(a, a);
29029 return __Pyx_c_prod_double(a, a);
29031 z = __Pyx_c_prod_double(a, a);
29032 return __Pyx_c_prod_double(
z, a);
29034 z = __Pyx_c_prod_double(a, a);
29035 return __Pyx_c_prod_double(
z,
z);
29041 }
else if (b.imag == 0) {
29042 z.real = pow(a.real, b.real);
29045 }
else if (a.real > 0) {
29050 theta = atan2(0, -1);
29053 r = __Pyx_c_abs_double(a);
29054 theta = atan2(a.imag, a.real);
29057 z_r = exp(lnr * b.real - theta * b.imag);
29058 z_theta = theta * b.real + lnr * b.imag;
29059 z.real = z_r * cos(z_theta);
29060 z.imag = z_r * sin(z_theta);
29067 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
29068 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) ((
enum NPY_TYPES) 0 - (
enum NPY_TYPES) 1), const_zero = (
enum NPY_TYPES) 0;
29069 const int is_unsigned = neg_one > const_zero;
29071 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
29072 return PyInt_FromLong((
long) value);
29073 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
29074 return PyLong_FromUnsignedLong((
unsigned long) value);
29075 #ifdef HAVE_LONG_LONG
29076 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
29077 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
29081 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
29082 return PyInt_FromLong((
long) value);
29083 #ifdef HAVE_LONG_LONG
29084 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
29085 return PyLong_FromLongLong((PY_LONG_LONG) value);
29090 int one = 1;
int little = (int)*(
unsigned char *)&one;
29091 unsigned char *bytes = (
unsigned char *)&value;
29092 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
29093 little, !is_unsigned);
29098 static __Pyx_memviewslice
29099 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
29100 const char *mode,
int ndim,
29101 size_t sizeof_dtype,
int contig_flag,
29102 int dtype_is_object)
29104 __Pyx_RefNannyDeclarations
29106 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
29107 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
29108 Py_buffer *buf = &from_memview->view;
29109 PyObject *shape_tuple = NULL;
29110 PyObject *temp_int = NULL;
29111 struct __pyx_array_obj *array_obj = NULL;
29112 struct __pyx_memoryview_obj *memview_obj = NULL;
29113 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
29114 for (i = 0; i < ndim; i++) {
29115 if (from_mvs->suboffsets[i] >= 0) {
29116 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
29117 "indirect dimensions (axis %d)", i);
29121 shape_tuple = PyTuple_New(ndim);
29122 if (unlikely(!shape_tuple)) {
29125 __Pyx_GOTREF(shape_tuple);
29126 for(i = 0; i < ndim; i++) {
29127 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
29128 if(unlikely(!temp_int)) {
29131 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
29135 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
29136 if (unlikely(!array_obj)) {
29139 __Pyx_GOTREF(array_obj);
29140 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
29141 (PyObject *) array_obj, contig_flag,
29143 from_mvs->memview->typeinfo);
29144 if (unlikely(!memview_obj))
29146 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
29148 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
29149 dtype_is_object) < 0))
29153 __Pyx_XDECREF(new_mvs.memview);
29154 new_mvs.memview = NULL;
29155 new_mvs.data = NULL;
29157 __Pyx_XDECREF(shape_tuple);
29158 __Pyx_XDECREF(temp_int);
29159 __Pyx_XDECREF(array_obj);
29160 __Pyx_RefNannyFinishContext();
29165 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
29166 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
29167 const int is_unsigned = neg_one > const_zero;
29168 #if PY_MAJOR_VERSION < 3
29169 if (likely(PyInt_Check(x))) {
29170 if (
sizeof(
int) <
sizeof(long)) {
29171 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
29173 long val = PyInt_AS_LONG(x);
29174 if (is_unsigned && unlikely(val < 0)) {
29175 goto raise_neg_overflow;
29181 if (likely(PyLong_Check(x))) {
29183 #if CYTHON_USE_PYLONG_INTERNALS
29184 const digit* digits = ((PyLongObject*)x)->ob_digit;
29185 switch (Py_SIZE(x)) {
29186 case 0:
return (
int) 0;
29187 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
29189 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
29190 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29191 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29192 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
29193 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
29198 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
29199 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29200 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29201 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
29202 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29207 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
29208 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29209 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29210 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
29211 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
29217 #if CYTHON_COMPILING_IN_CPYTHON
29218 if (unlikely(Py_SIZE(x) < 0)) {
29219 goto raise_neg_overflow;
29223 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29224 if (unlikely(result < 0))
29226 if (unlikely(result == 1))
29227 goto raise_neg_overflow;
29230 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
29231 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
29232 #ifdef HAVE_LONG_LONG
29233 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
29234 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29238 #if CYTHON_USE_PYLONG_INTERNALS
29239 const digit* digits = ((PyLongObject*)x)->ob_digit;
29240 switch (Py_SIZE(x)) {
29241 case 0:
return (
int) 0;
29242 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
29243 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
29245 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
29246 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29247 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29248 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
29249 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
29254 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
29255 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29256 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29257 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
29258 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
29263 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
29264 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29265 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29266 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
29267 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29272 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
29273 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29274 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29275 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
29276 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29281 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
29282 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29283 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29284 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
29285 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
29290 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
29291 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29292 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29293 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
29294 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
29300 if (
sizeof(
int) <=
sizeof(long)) {
29301 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
29302 #ifdef HAVE_LONG_LONG
29303 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
29304 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
29309 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29310 PyErr_SetString(PyExc_RuntimeError,
29311 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29314 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
29315 #if PY_MAJOR_VERSION < 3
29316 if (likely(
v) && !PyLong_Check(
v)) {
29318 v = PyNumber_Long(tmp);
29323 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
29324 unsigned char *bytes = (
unsigned char *)&val;
29325 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
29326 bytes,
sizeof(val),
29327 is_little, !is_unsigned);
29337 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29338 if (!tmp)
return (
int) -1;
29339 val = __Pyx_PyInt_As_int(tmp);
29344 PyErr_SetString(PyExc_OverflowError,
29345 "value too large to convert to int");
29347 raise_neg_overflow:
29348 PyErr_SetString(PyExc_OverflowError,
29349 "can't convert negative value to int");
29354 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
29355 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
29356 const int is_unsigned = neg_one > const_zero;
29357 #if PY_MAJOR_VERSION < 3
29358 if (likely(PyInt_Check(x))) {
29359 if (
sizeof(
long) <
sizeof(long)) {
29360 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
29362 long val = PyInt_AS_LONG(x);
29363 if (is_unsigned && unlikely(val < 0)) {
29364 goto raise_neg_overflow;
29370 if (likely(PyLong_Check(x))) {
29372 #if CYTHON_USE_PYLONG_INTERNALS
29373 const digit* digits = ((PyLongObject*)x)->ob_digit;
29374 switch (Py_SIZE(x)) {
29375 case 0:
return (
long) 0;
29376 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
29378 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
29379 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29380 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29381 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
29382 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
29387 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
29388 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29389 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29390 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
29391 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29396 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
29397 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29398 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29399 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
29400 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
29406 #if CYTHON_COMPILING_IN_CPYTHON
29407 if (unlikely(Py_SIZE(x) < 0)) {
29408 goto raise_neg_overflow;
29412 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29413 if (unlikely(result < 0))
29415 if (unlikely(result == 1))
29416 goto raise_neg_overflow;
29419 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
29420 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
29421 #ifdef HAVE_LONG_LONG
29422 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
29423 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29427 #if CYTHON_USE_PYLONG_INTERNALS
29428 const digit* digits = ((PyLongObject*)x)->ob_digit;
29429 switch (Py_SIZE(x)) {
29430 case 0:
return (
long) 0;
29431 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
29432 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
29434 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
29435 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29436 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29437 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
29438 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
29443 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
29444 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29445 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29446 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
29447 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
29452 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
29453 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29454 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29455 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
29456 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29461 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
29462 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29463 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29464 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
29465 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29470 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
29471 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29472 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29473 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
29474 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
29479 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
29480 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29481 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29482 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
29483 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
29489 if (
sizeof(
long) <=
sizeof(long)) {
29490 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
29491 #ifdef HAVE_LONG_LONG
29492 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
29493 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
29498 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29499 PyErr_SetString(PyExc_RuntimeError,
29500 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29503 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
29504 #if PY_MAJOR_VERSION < 3
29505 if (likely(
v) && !PyLong_Check(
v)) {
29507 v = PyNumber_Long(tmp);
29512 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
29513 unsigned char *bytes = (
unsigned char *)&val;
29514 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
29515 bytes,
sizeof(val),
29516 is_little, !is_unsigned);
29526 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29527 if (!tmp)
return (
long) -1;
29528 val = __Pyx_PyInt_As_long(tmp);
29533 PyErr_SetString(PyExc_OverflowError,
29534 "value too large to convert to long");
29536 raise_neg_overflow:
29537 PyErr_SetString(PyExc_OverflowError,
29538 "can't convert negative value to long");
29543 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
29544 const char neg_one = (char) ((
char) 0 - (char) 1), const_zero = (char) 0;
29545 const int is_unsigned = neg_one > const_zero;
29546 #if PY_MAJOR_VERSION < 3
29547 if (likely(PyInt_Check(x))) {
29548 if (
sizeof(
char) <
sizeof(long)) {
29549 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
29551 long val = PyInt_AS_LONG(x);
29552 if (is_unsigned && unlikely(val < 0)) {
29553 goto raise_neg_overflow;
29559 if (likely(PyLong_Check(x))) {
29561 #if CYTHON_USE_PYLONG_INTERNALS
29562 const digit* digits = ((PyLongObject*)x)->ob_digit;
29563 switch (Py_SIZE(x)) {
29564 case 0:
return (
char) 0;
29565 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
29567 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
29568 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29569 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29570 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
29571 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
29576 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
29577 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29578 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29579 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
29580 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29585 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
29586 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29587 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29588 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
29589 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
29595 #if CYTHON_COMPILING_IN_CPYTHON
29596 if (unlikely(Py_SIZE(x) < 0)) {
29597 goto raise_neg_overflow;
29601 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29602 if (unlikely(result < 0))
29604 if (unlikely(result == 1))
29605 goto raise_neg_overflow;
29608 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
29609 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
29610 #ifdef HAVE_LONG_LONG
29611 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
29612 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29616 #if CYTHON_USE_PYLONG_INTERNALS
29617 const digit* digits = ((PyLongObject*)x)->ob_digit;
29618 switch (Py_SIZE(x)) {
29619 case 0:
return (
char) 0;
29620 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
29621 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
29623 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
29624 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29625 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29626 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
29627 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29632 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
29633 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
29634 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29635 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
29636 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29641 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
29642 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29643 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29644 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
29645 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29650 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
29651 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
29652 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29653 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
29654 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29659 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
29660 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29661 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29662 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
29663 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29668 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
29669 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
29670 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
29671 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
29672 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
29678 if (
sizeof(
char) <=
sizeof(long)) {
29679 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
29680 #ifdef HAVE_LONG_LONG
29681 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
29682 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
29687 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29688 PyErr_SetString(PyExc_RuntimeError,
29689 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29692 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
29693 #if PY_MAJOR_VERSION < 3
29694 if (likely(
v) && !PyLong_Check(
v)) {
29696 v = PyNumber_Long(tmp);
29701 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
29702 unsigned char *bytes = (
unsigned char *)&val;
29703 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
29704 bytes,
sizeof(val),
29705 is_little, !is_unsigned);
29715 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29716 if (!tmp)
return (
char) -1;
29717 val = __Pyx_PyInt_As_char(tmp);
29722 PyErr_SetString(PyExc_OverflowError,
29723 "value too large to convert to char");
29725 raise_neg_overflow:
29726 PyErr_SetString(PyExc_OverflowError,
29727 "can't convert negative value to char");
29732 static int __Pyx_check_binary_version(
void) {
29733 char ctversion[4], rtversion[4];
29734 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29735 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
29736 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29738 PyOS_snprintf(message,
sizeof(message),
29739 "compiletime version %s of module '%.100s' "
29740 "does not match runtime version %s",
29741 ctversion, __Pyx_MODULE_NAME, rtversion);
29742 return PyErr_WarnEx(NULL, message, 1);
29748 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29750 #if PY_MAJOR_VERSION < 3
29751 if (t->is_unicode) {
29752 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29753 }
else if (t->intern) {
29754 *t->p = PyString_InternFromString(t->s);
29756 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29759 if (t->is_unicode | t->is_str) {
29761 *t->p = PyUnicode_InternFromString(t->s);
29762 }
else if (t->encoding) {
29763 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29765 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29768 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29773 if (PyObject_Hash(*t->p) == -1)
29780 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
29781 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29783 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
29785 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29787 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29788 #if !CYTHON_PEP393_ENABLED
29789 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29791 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29792 if (!defenc)
return NULL;
29793 defenc_c = PyBytes_AS_STRING(defenc);
29794 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29796 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29798 for (
c = defenc_c;
c < end;
c++) {
29799 if ((
unsigned char) (*
c) >= 128) {
29800 PyUnicode_AsASCIIString(o);
29806 *length = PyBytes_GET_SIZE(defenc);
29810 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29811 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
29812 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29813 if (likely(PyUnicode_IS_ASCII(o))) {
29814 *length = PyUnicode_GET_LENGTH(o);
29815 return PyUnicode_AsUTF8(o);
29817 PyUnicode_AsASCIIString(o);
29821 return PyUnicode_AsUTF8AndSize(o, length);
29826 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29827 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29829 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29830 __Pyx_sys_getdefaultencoding_not_ascii &&
29832 PyUnicode_Check(o)) {
29833 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29836 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29837 if (PyByteArray_Check(o)) {
29838 *length = PyByteArray_GET_SIZE(o);
29839 return PyByteArray_AS_STRING(o);
29844 int r = PyBytes_AsStringAndSize(o, &result, length);
29845 if (unlikely(
r < 0)) {
29852 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
29853 int is_true = x == Py_True;
29854 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
29855 else return PyObject_IsTrue(x);
29857 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29859 if (unlikely(!x))
return -1;
29860 retval = __Pyx_PyObject_IsTrue(x);
29864 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
29865 #if PY_MAJOR_VERSION >= 3
29866 if (PyLong_Check(result)) {
29867 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29868 "__int__ returned non-int (type %.200s). "
29869 "The ability to return an instance of a strict subclass of int "
29870 "is deprecated, and may be removed in a future version of Python.",
29871 Py_TYPE(result)->tp_name)) {
29878 PyErr_Format(PyExc_TypeError,
29879 "__%.4s__ returned non-%.4s (type %.200s)",
29880 type_name, type_name, Py_TYPE(result)->tp_name);
29884 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29885 #if CYTHON_USE_TYPE_SLOTS
29886 PyNumberMethods *m;
29888 const char *name = NULL;
29889 PyObject *res = NULL;
29890 #if PY_MAJOR_VERSION < 3
29891 if (likely(PyInt_Check(x) || PyLong_Check(x)))
29893 if (likely(PyLong_Check(x)))
29895 return __Pyx_NewRef(x);
29896 #if CYTHON_USE_TYPE_SLOTS
29897 m = Py_TYPE(x)->tp_as_number;
29898 #if PY_MAJOR_VERSION < 3
29899 if (m && m->nb_int) {
29901 res = m->nb_int(x);
29903 else if (m && m->nb_long) {
29905 res = m->nb_long(x);
29908 if (likely(m && m->nb_int)) {
29910 res = m->nb_int(x);
29914 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29915 res = PyNumber_Int(x);
29919 #if PY_MAJOR_VERSION < 3
29920 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29922 if (unlikely(!PyLong_CheckExact(res))) {
29924 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29927 else if (!PyErr_Occurred()) {
29928 PyErr_SetString(PyExc_TypeError,
29929 "an integer is required");
29933 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29936 #if PY_MAJOR_VERSION < 3
29937 if (likely(PyInt_CheckExact(b))) {
29938 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
29939 return PyInt_AS_LONG(b);
29941 return PyInt_AsSsize_t(b);
29944 if (likely(PyLong_CheckExact(b))) {
29945 #if CYTHON_USE_PYLONG_INTERNALS
29946 const digit* digits = ((PyLongObject*)b)->ob_digit;
29947 const Py_ssize_t size = Py_SIZE(b);
29948 if (likely(__Pyx_sst_abs(size) <= 1)) {
29949 ival = likely(size) ? digits[0] : 0;
29950 if (size == -1) ival = -ival;
29955 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29956 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29960 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29961 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29965 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29966 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29970 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29971 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29975 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29976 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29980 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29981 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29987 return PyLong_AsSsize_t(b);
29989 x = PyNumber_Index(b);
29991 ival = PyInt_AsSsize_t(x);
29995 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
29996 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29998 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
29999 return PyInt_FromSize_t(ival);